Beispiel #1
0
    private void ChangeTideState()
    {
        switch (state)
        {
        case TideState.STILL:
            if (rising == 3)
            {
                rising = 0;
                if (maxLayerReached)
                {
                    state = TideState.RISING;
                }
                else
                {
                    state = TideState.FALLING;
                }
            }
            else
            {
                if (maxLayerReached)
                {
                    state = TideState.FALLING;
                }
                else
                {
                    state = TideState.RISING;
                }
            }
            rising++;
            break;

        default:
            state = TideState.STILL;
            break;
        }
        if (actualLayer == maxLayer)
        {
            maxLayerReached = true;
            rising          = 1;
        }
        else if (actualLayer == minLayer)
        {
            maxLayerReached = false;
            rising          = 1;
        }
    }
Beispiel #2
0
 private void CheatyStateSettings()
 {
     if (Input.GetKeyDown(KeyCode.B))
     {
         state = TideState.FALLING;
         Debug.Log("Change to FALLING");
     }
     if (Input.GetKeyDown(KeyCode.N))
     {
         state = TideState.STILL;
         Debug.Log("Change to STILL");
     }
     if (Input.GetKeyDown(KeyCode.M))
     {
         state = TideState.RISING;
         Debug.Log("Change to RISING");
     }
 }
Beispiel #3
0
 public void SetTideState(TideState state)
 {
     this.state = state;
 }