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