예제 #1
0
 // public float minSpeedToSplashSound = 5f;
 void OnTriggerEnter(Collider c)
 {
     if ( c.GetComponent<FirstPerson>() ) {
         player = c.GetComponent<FirstPerson>();
         pullMove = player.GetComponent<PullMove>();
         player.isSwimming = true;
     }
 }
예제 #2
0
 void OnTriggerExit( Collider c )
 {
     if ( player != null && c.collider == player.collider ) {
         player.isSwimming = false;
         player = null;
         pullMove = null;
     }
 }
예제 #3
0
        /// <summary>
        /// Pulls the arc in the given direction. Return true if this operation is valid and was
        /// executed.
        /// </summary>
        public bool PullArc(Arc arc, Direction pullDir)
        {
            if (IsPulled || arc == null)
            {
                return(false);
            }

            var move   = new PullMove(_gameBoard, _player, arc, pullDir);
            var result = _player.PlayMove(move);

            if (result)
            {
                _moveHistory.Add(move);
                PlayerState.UpdatePush(arc);
            }

            PulledArc       = result ? arc : PulledArc;
            PulledDirection = result ? pullDir : PulledDirection;
            return(result);
        }
예제 #4
0
 // Use this for initialization
 void Awake()
 {
     cam = GetComponentInChildren<Camera>();
     pullMove = GetComponent<PullMove>();
     Screen.lockCursor = true;
 }