// public float minSpeedToSplashSound = 5f; void OnTriggerEnter(Collider c) { if ( c.GetComponent<FirstPerson>() ) { player = c.GetComponent<FirstPerson>(); pullMove = player.GetComponent<PullMove>(); player.isSwimming = true; } }
void OnTriggerExit( Collider c ) { if ( player != null && c.collider == player.collider ) { player.isSwimming = false; player = null; pullMove = null; } }
/// <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); }
// Use this for initialization void Awake() { cam = GetComponentInChildren<Camera>(); pullMove = GetComponent<PullMove>(); Screen.lockCursor = true; }