Example #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;
 }
Example #2
0
 void Start()
 {
     if (source != null)
     {
         upVector = source.Value.GetComponentInChildren <IGravity>();
     }
 }
Example #3
0
        public virtual void ResetAnimal()
        {
            if (animal != null)    animal.Gravity = Vector3.down;

            animal = null;
            Other = null;
        }
Example #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;
     }
 }
Example #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;
        }
Example #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>();
        }
Example #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>();
 }
Example #10
0
 void Start()
 {
     upVector = source?.GetComponentInChildren <IGravity>();
 }