clxs
clxs
CC#
Created by Kinda Ducky on 2/21/2024 in #help
SpawnEnemy lore (scope and what not)
That's right yep
19 replies
CC#
Created by Kinda Ducky on 2/21/2024 in #help
SpawnEnemy lore (scope and what not)
That one also returns a value between 0 and the value you gave it (exclusively, meaning 2)
19 replies
CC#
Created by Kinda Ducky on 2/21/2024 in #help
SpawnEnemy lore (scope and what not)
19 replies
CC#
Created by Kinda Ducky on 2/21/2024 in #help
SpawnEnemy lore (scope and what not)
One thing to look at is this line int level = ed.Next(0, 3); Look at the docs for how Random.Next works https://learn.microsoft.com/en-us/dotnet/api/system.random.next?view=net-8.0#system-random-next(system-int32-system-int32) That'll be returning a value between 0 and 2, is that what you'd expected?
19 replies
CC#
Created by Ryerson on 5/24/2023 in #help
❔ help please
Where baseForwardVector is whatever direction is "forwards" for a non translated square
20 replies
CC#
Created by Ryerson on 5/24/2023 in #help
❔ help please
The forward vector for this car, the direction you need to move in is then forwardVector = baseForwardVector * square.Transform
20 replies
CC#
Created by Ryerson on 5/24/2023 in #help
❔ help please
Say your square is 10x10 and is at 6,6 square.Transform = Matrix.Translate2D(-(3 + 5), - (3 + 5)) * Matrix.Rotate2D(30_deg) * Matrix.Translate2D((3 + 5), (3 + 5)) Exact methods you need to use depend what you're doing it in
20 replies
CC#
Created by Ryerson on 5/24/2023 in #help
❔ help please
Translate so the centre point of the square is at 0,0, rotate, translate back
20 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
What error does it give
37 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
That might be the editor simplifying it, but .rotation is a Quaternion instead of an eulerian rotaiton
37 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
So rotation = rotation * quat; will give you a rotation that's the result of rotation + quaternion
37 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
And just like matricies, you multiply them to combine multiple of these "orders"
37 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
They're much closer to a Matrix representing the transform of a point
37 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
Quaternions don't represent a rotation in the way you're picture, a set of Eulerian rotations you're thinking of
37 replies
CC#
Created by Cerius on 5/15/2023 in #help
❔ It don't work I'm a Unity beginner.
You dont add quaternions, you multiply them
37 replies
CC#
Created by CDS on 2/7/2023 in #help
❔ Enumerating Running Processes
Sure, but please dont credit it's not great lul
140 replies
CC#
Created by CDS on 2/7/2023 in #help
❔ Enumerating Running Processes
Its my own class, I define it in that block
140 replies
CC#
Created by CDS on 2/7/2023 in #help
❔ Enumerating Running Processes
If you wanted to be really safe a solution would be to wrap it in your own disposable container. Notepad code following
class DisposableList<T> : List<T>, IDisposable where T : IDisposable
{
DisposableList(){}
DisposableList(IEnumerable<T> items)
: base(items)
{
}

void Dispose() => this.ForEach(i => i?.Dispose());
}

DisposableList<Process> RunningProcesses => new(Process.GetProcesses());

using var processes = RunningProcesses;
class DisposableList<T> : List<T>, IDisposable where T : IDisposable
{
DisposableList(){}
DisposableList(IEnumerable<T> items)
: base(items)
{
}

void Dispose() => this.ForEach(i => i?.Dispose());
}

DisposableList<Process> RunningProcesses => new(Process.GetProcesses());

using var processes = RunningProcesses;
Imo that's just overkill though
140 replies
CC#
Created by CDS on 2/7/2023 in #help
❔ Enumerating Running Processes
It would be less bad if you only disposed the processes which needed it, there's not much point of a cache if the entire thing is invalidated every use. Note, you don't really need to Dispose them. The finalizer will do that on GC. It's good to do so, but you won't leak if not
140 replies