Esempio n. 1
0
 /* 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> ();
 }
Esempio n. 2
0
 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;
         }
     }
 }
Esempio n. 3
0
 /* 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> ();
 }
Esempio n. 4
0
 void Awake()
 {
     attackCast = GetComponentInChildren <AttackCast> ();
 }
Esempio n. 5
0
 void Awake()
 {
     attackCast = GetComponentInChildren<AttackCast> ();
 }
Esempio n. 6
0
 void Awake()
 {
     projectileBody = GetComponentInChildren<Rigidbody> ();
     attackCast = GetComponentInChildren<AttackCast> ();
     keepAlive = true;
 }
Esempio n. 7
0
 void Awake()
 {
     projectileBody = GetComponentInChildren <Rigidbody> ();
     attackCast     = GetComponentInChildren <AttackCast> ();
     keepAlive      = true;
 }