/* Assigns references to private fields that the character will use */ void AssignReferences() { health = gameObject.GetComponent <Health> (); motor = gameObject.GetComponent <CharacterMotor> (); animator = gameObject.GetComponent <Animator> (); usesAnimation = animator != null; attackCaster = gameObject.GetComponentInChildren <AttackCast> (); }
void Awake() { myTransform = transform; // TODO make this check for controller == null, otherwise // it always overrides the one chosen in the editor. controller = GetComponent <IController> (); attackCaster = GetComponentInChildren <AttackCast> (); if (attackCaster != null) { attackCaster.gameObject.SetActive(false); } stamina = GetComponent <Stamina> (); health = GetComponent <Health> (); bandages = GetComponent <Bandages> (); if (swingTrail == null) { swingTrail = GetComponentInChildren <TrailRenderer> (); if (swingTrail != null) { swingTrail.renderer.enabled = false; } } }
/* Assigns references to private fields that the character will use */ void AssignReferences() { health = gameObject.GetComponent<Health> (); motor = gameObject.GetComponent<CharacterMotor> (); animator = gameObject.GetComponent<Animator> (); usesAnimation = animator != null; attackCaster = gameObject.GetComponentInChildren<AttackCast> (); }
void Awake() { attackCast = GetComponentInChildren <AttackCast> (); }
void Awake() { attackCast = GetComponentInChildren<AttackCast> (); }
void Awake() { projectileBody = GetComponentInChildren<Rigidbody> (); attackCast = GetComponentInChildren<AttackCast> (); keepAlive = true; }
void Awake() { projectileBody = GetComponentInChildren <Rigidbody> (); attackCast = GetComponentInChildren <AttackCast> (); keepAlive = true; }