예제 #1
0
        /// <summary>This method instantiates the soul related non Mono Behaviour scripts and connects it with this script.
        /// Also finds the orbitingCenter, Gate and rigidbody.
        /// </summary>
        private void Start()
        {
            rb = GetComponent <Rigidbody>();

            soulMovement      = new SoulMovement();
            soulMovement.soul = this;

            orbitingCenter = GameObject.FindGameObjectWithTag("OrbitingCenter");
            gate           = GameObject.FindGameObjectWithTag("Gate").GetComponent <Gate>();
        }
예제 #2
0
 /// <summary>
 /// If Gameobject is destroyed, cleanup the other scripts in Soul.
 /// </summary>
 private void OnDestroy()
 {
     soulMovement.CleanUp();
     soulMovement = null;
 }