Lately I've been playing around with Unity3D. The one fun thing was, you were able to execute command from another file by using.GetComponent()
. What you were able to do is, for example set users speed, even though script wasn't attached to player, so you technically were able to execute a function (void
), from another script and actually make it work, you could've managed player by saying
public GameObject Player;
Player.AddForce("20");
I do realize this is familiar thing as OOP. But I can't seem to find clear tutorial in pure C#. You included external script with GetComponent()
, but I don't think MS's .NET libraries have such a command. I've Googled so far, but I cannot find name for it, and OOP programming is already basically known by me, just not this type. Do you maybe know how to issue/use such a thing? Or maybe you know how it's called, so I can Google it instead?
@edit
Another example of part of script that I found that is using this:
using (AllocatedMemory memory = new AllocatedMemory(4)) {
Executor executor = new Executor();
IntPtr FloatingFont = Memory.Base.Read<IntPtr>((IntPtr)Offsets.LoL.FloatingFont);
memory.WriteString(Text);
executor.AddLine("push {0}", ObjectManager.Me.BaseAddress);
executor.AddLine("push 0");
executor.AddLine("push {0}", memory.Address);
executor.AddLine("push {0}", Type);
executor.AddLine("push {0}", GameObject.BaseAddress);
executor.AddLine("mov esi, {0}", GameObject.BaseAddress);
executor.AddLine("xor edi, edi");
executor.AddLine("xor ebx, ebx");
executor.AddLine("mov ecx, {0}", FloatingFont);
executor.AddLine("mov eax, {0}", ObjectManager.Me.BaseAddress);
executor.AddLine("call {0}", Offsets.LoL.DrawFloatText);
executor.AddLine("ret");
executor.Execute();
}
Someone has created (or it was pre-created) executor
and it has functions AddLine();
and Execute();
, I'd love to learn to create own things like this.