void Start() { SetAABB(); engine = GameObject.FindWithTag("PhysicsEngine").GetComponent <PhysicsEngine>(); engine.AddRigidBody(this); }
void Start() { //When this script first runs this function is ran (Like the Main of a normal program in c++ or Whatever) //Runs the SetAABB Function Once //Finds one Object in Game Land with the Hashtag "PhysicsEngine" //Finds the Component (Like a member) called <PhysicsEngine> //Uses the PhysicsEngine attached to the Object to add a Rigidbody to the Attached (To the Script) object SetAABB(); engine = GameObject.FindWithTag("PhysicsEngine").GetComponent <PhysicsEngine>(); engine.AddRigidBody(this); }