protected override void Awake() { base.Awake(); gameObject.tag = "Player"; gameObject.SetLayer("Player"); Pointer = new GameObject("pointer").transform; Mover.target = Pointer; whistle = Tr.Find("Whistle"); whistle.localScale = Vector3.zero; }
protected override void Awake() { base.Awake(); Arms = new Transform[] { Tr.Find("Arm_L"), Tr.Find("Arm_R") }; Weapons = GetComponentsInChildren <Weapon>(); for (int i = 0; Weapons.Length > i; i++) { Weapons[i].parent = this; } Rigid.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ; Health.onDie.AddListener(h => Disable()); Mover = GetComponent <CubeKunMover>(); Mover.parent = this; }