private void Awake() { navMeshAgent = GetComponent <NavMeshAgent>(); sphereCollider = GetComponent <SphereCollider>(); equipment = GetComponent <ActorEquipment>(); rigidbodyRef = GetComponent <Rigidbody>(); }
void Awake() { //m_Animator = GetComponent<Animator>(); m_Rigidbody = GetComponent <Rigidbody>(); m_Capsule = GetComponent <CapsuleCollider>(); m_CharacterObject = transform.Find("CharacterBody").gameObject; m_CapsuleHeight = m_Capsule.height; m_CapsuleCenter = m_Capsule.center; charEquipment = GetComponent <ActorEquipment>(); camObj = GameObject.FindWithTag("MainCamera"); camFoward = camObj.transform.parent.forward.normalized; m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; m_OrigGroundCheckDistance = m_GroundCheckDistance; }
private void Start() { switch (playerNum) { case PlayerNumber.Player_1: playerPrefix = "p1"; playerPos = 1; break; case PlayerNumber.Player_2: playerPrefix = "p2"; playerPos = 2; break; case PlayerNumber.Player_3: playerPrefix = "p3"; playerPos = 3; break; case PlayerNumber.Player_4: playerPrefix = "p4"; playerPos = 4; break; default: break; } // get the transform of the main camera m_Cam = GameObject.FindWithTag("MainCamera").transform; m_CamForward = m_Cam.forward; // get the third person character ( this should never be null due to require component ) m_Character = GetComponent <ThirdPersonCharacter>(); m_Rigidbody = GetComponent <Rigidbody>(); actorEquipment = GetComponent <ActorEquipment>(); actorInteraction = GetComponent <ActorInteraction>(); }
public void Awake() { actorEquipment = GetComponent <ActorEquipment>(); }