void Awake() { healthDisplay = transform.Find("Health").GetComponent <TextMesh>(); anim = GetComponent <Animator>(); Transform rightHand = anim.GetBoneTransform(HumanBodyBones.RightHand); saber = rightHand.Find("LSaber/Beam").gameObject; saberCont = rightHand.GetComponentInChildren <SaberController>(); rb = GetComponent <Rigidbody>(); health = MAX_HEALTH; }
void Awake() { healthDisplay = transform.Find("Health").GetComponent<TextMesh>(); anim = GetComponent<Animator>(); Transform rightHand = anim.GetBoneTransform(HumanBodyBones.RightHand); saber = rightHand.Find("LSaber/Beam").gameObject; saberCont = rightHand.GetComponentInChildren<SaberController>(); rb = GetComponent<Rigidbody>(); health = MAX_HEALTH; }