public void Use(CharacterAction aActor) { if(m_OneShot) { m_User = aActor; OnUse(); } else if(m_UseTime <= 0.0f) { m_User = aActor; m_InUse = true; OnUse(); } }
// Use this for initialization void Start() { m_GroundCheckMask = ~LayerMask.GetMask("Player"); m_CharacterController = GetComponent<CharacterController>(); m_CharacterAction = GetComponent<CharacterAction>(); m_Unit = GetComponent<Unit>(); m_Animator = GetComponentInChildren<Animator>(); if (m_Animator != null) { m_ForwardID = Animator.StringToHash(ANIMATION_FORWARD); m_SideID = Animator.StringToHash(ANIMATION_SIDE); m_IsAttackingID = Animator.StringToHash(ANIMATION_IS_ATTACKING); m_AttackSwordID = Animator.StringToHash(ANIMATION_ATTACK_SWORD); m_AttackWandID = Animator.StringToHash(ANIMATION_ATTACK_WAND); m_AttackMotionID = Animator.StringToHash(ANIMATION_ATTACK_MOTION); m_AttackGunID = Animator.StringToHash(ANIMATION_ATTACK_GUN); } Camera gameplayCamera = Game.gameplayCamera; m_CharacterCamera = gameplayCamera.GetComponent<CharacterCamera>(); if (m_CharacterCamera != null) { m_CharacterCamera.positionCam = m_Head; m_CharacterCamera.xRotCam = m_VerticalLook; m_CharacterCamera.yRotCam = transform; } }