Esempio n. 1
0
 void Awake()
 {
     a_UpVector            = GetComponent <IGravity>(); //Get the main camera
     aimer                 = GetComponent <IAim>();     //Get the main camera
     Anim                  = GetComponent <Animator>(); //Get the main camera
     aimer.IgnoreTransform = transform;
 }
Esempio n. 2
0
 void Start()
 {
     if (source != null)
     {
         upVector = source.Value.GetComponentInChildren <IGravity>();
     }
 }
Esempio n. 3
0
        public virtual void ResetAnimal()
        {
            if (animal != null)    animal.Gravity = Vector3.down;

            animal = null;
            Other = null;
        }
Esempio n. 4
0
 //this addbehaviour overide also stores the gravity behaviour in a seperate variable
 public override void AddBehaviour(IBehaviour pBehaviour)
 {
     _mMind.Add(pBehaviour);
     if (pBehaviour is IGravity)
     {
         _mGrav = (IGravity)pBehaviour;
     }
 }
Esempio n. 5
0
 void Awake()
 {
     VelAcc  = GetComponent <IVelocityAccumulator>();
     Gravity = GetComponent <IGravity>();
     if (Gravity == null)
     {
         throw new UnityException("PlayerJumping requires an IGravity component attached to the same GameObject.");
     }
 }
        public virtual void ResetAnimal()
        {
            if (animal != null)
            {
                animal.GravityDirection = Vector3.down;
            }

            animal = null;
            Other  = null;
        }
Esempio n. 7
0
        private void Awake()
        {
            Application.quitting += HandleQuit;

            //NOTE: Silly me, forgot that default unity inspector apparently doesn't show
            //controls for interfaces - just hacking this together automagically.
            Gravity = GetComponent <IGravity>();
            Jumper  = GetComponent <IJumper>();
            Mover   = GetComponent <IMover>();
            Aimer   = GetComponent <IAimer>();
        }
Esempio n. 8
0
        void GetTargetGravity()
        {
            if (Target != null)
            {
                TargetGravity = Target.GetComponentInChildren <IGravity>();

                if (TargetGravity == null)
                {
                    TargetGravity = Target.GetComponentInParent <IGravity>();
                }
            }
        }
 void OnTriggerEnter(Collider other)
 {
     Other  = other;
     animal = other.GetComponentInParent <IGravity>();
 }
Esempio n. 10
0
 void Start()
 {
     upVector = source?.GetComponentInChildren <IGravity>();
 }