예제 #1
0
 public bool TryStartHighlight(PlayerHandController hand)
 {
     if (!m_handsHighlightingMe.Contains(hand))
     {
         m_handsHighlightingMe.Add(hand);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #2
0
 public bool TryEndHighlight(PlayerHandController hand)
 {
     if (m_handsHighlightingMe.Contains(hand))
     {
         m_handsHighlightingMe.Remove(hand);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #3
0
 public virtual bool TryStartInteraction(PlayerHandController hand)
 {
     if (m_isTwoHanded || m_handsInteractingWithMe.Count == 0)
     {
         m_handsInteractingWithMe.Add(hand);
         m_interactionStartPoint.Add(hand, hand.gameObject.transform.position);
         return(true);
     }
     else
     {
         return(false);
     }
 }
 public override bool TryStartInteraction(PlayerHandController hand)
 {
     if (base.TryStartInteraction(hand))
     {
         hand.OnFaceButtonDown.AddListener(OnFaceButtonDown);
         hand.OnTriggerDown.AddListener(OnTriggerDown);
         hand.OnTriggerUp.AddListener(OnTriggerUp);
         return(true);
     }
     else
     {
         return(false);
     }
 }
        public override bool TryEndInteraction(PlayerHandController hand)
        {
            if (base.TryEndInteraction(hand))
            {
                hand.OnFaceButtonDown.RemoveListener(OnFaceButtonDown);
                hand.OnTriggerDown.RemoveListener(OnTriggerDown);
                hand.OnTriggerUp.RemoveListener(OnTriggerUp);
                m_handsPullingTrigger.Remove(hand);

                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #6
0
        private IEnumerator Start()
        {
            SetStatus(StandardStatus.INITIALIZATION_RUNNING);

            yield return(new WaitWhile(() => GameManager.Instance == null));

            yield return(new WaitWhile(() => GameManager.Instance.InputManager == null));

            yield return(new WaitWhile(() => !GameManager.Instance.InputManager.IsInitialized));

            if (m_playerHead == null)
            {
                SetStatus($"{nameof(m_playerHead)} not assigned. Looking for one now...", LogType.Warning);
                m_playerHead = gameObject.GetComponentInChildren <PlayerHeadController>(true);

                if (m_playerHead == null)
                {
                    SetStatus("No Head", LogType.Error);
                    yield break;
                }
                else
                {
                    Log("Found a head");
                }
            }

            if (m_playerHandLeft == null)
            {
                SetStatus($"{nameof(m_playerHandLeft)} not assigned. Looking for one now...", LogType.Warning);
                m_playerHandLeft = FindHand(PlayerHandController.HandSide.Left);
            }

            if (m_playerHandRight == null)
            {
                SetStatus($"{nameof(m_playerHandRight)} not assigned. Looking for one now...", LogType.Warning);
                m_playerHandRight = FindHand(PlayerHandController.HandSide.Right);
            }

            var inputStates = GameManager.Instance.InputManager.InputStates;

            inputStates[m_thumbXYButtonLeftInputName].OnInputDown.AddListener(OnAnyThumbXYButtonDown);
            inputStates[m_thumbXYButtonRightInputName].OnInputDown.AddListener(OnAnyThumbXYButtonDown);

            ResetPlayerRootTransform();

            SetInitialized();
        }
예제 #7
0
 public virtual bool TryEndInteraction(PlayerHandController hand)
 {
     m_handsInteractingWithMe.Remove(hand);
     m_interactionStartPoint.Remove(hand);
     return(true);
 }
 private void OnFaceButtonDown(PlayerHandController hand)
 {
     OnSpecialWeaponTriggered.Invoke();
 }
 private void OnTriggerUp(PlayerHandController hand)
 {
     m_handsPullingTrigger.Remove(hand);
 }
 private void OnTriggerDown(PlayerHandController hand)
 {
     m_handsPullingTrigger.Add(hand);
 }