Beispiel #1
0
 void bSubmit(Vector3 point)
 {
     if (_state != State.Wall)
     {
         if (canBuild == true && hasCollision == false)
         {
             eventManager.BuildRequest(requestLocation, buildType);
         }
     }
     else
     {
         // in "Wall" State left click events.
         if (canBuild == true && hasCollision == false)
         {
             points.Add(requestLocation);
             if (_wall == wallState.wallPreview)
             {
                 staticPreview();
             }
             if (_wall == wallState.setWallCursor)
             {
                 _wall = wallState.wallPreview;
             }
         }
     }
 }
Beispiel #2
0
    public void changeActive()
    {
        switch (state)
        {
        case wallState.ACTIVE:
            state = wallState.INACTIVE;
            break;

        case wallState.INACTIVE:
            state = wallState.ACTIVE;
            break;
        }
    }
Beispiel #3
0
 void escCancel(Vector3 point)
 {
     if (_state != State.Wall)
     {
         buildCursor.SetActive(false);
         negBuildCursor.SetActive(false);
         eventManager.ButtonExit(this.gameObject);
         _state = State.Idle;
     }
     else
     {
         _wall = wallState.clear;
     }
 }
Beispiel #4
0
 void bRotate(Vector3 point)
 {
     if (_state != State.Wall)
     {
         if (buildCursor != null)
         {
             buildCursor.transform.Rotate(0, rotationStep, 0);
         }
     }
     else
     {
         _wall = wallState.wallCheck;
     }
 }
Beispiel #5
0
 // Event Based State Swtiches
 void bCursor(Vector3 Point, int Type)
 {
     if (Type != 11)
     {
         buildType = Type;
         _state    = State.SetBuildCursor;
     }
     else
     {
         requestPoints.Clear();
         buildType = Type;
         _wall     = wallState.setWallCursor;
         _state    = State.Wall;
     }
 }
Beispiel #6
0
    public void ChangeWallState(wallState stateToChange)
    {
        switch (stateToChange)
        {
        case wallState.broken:
            BreakSound();
            break;

        case wallState.repaired:
            RepairSound();

            break;

        case wallState.clean:
            CleanSound();
            break;
        }
        thisState = stateToChange;
        wallSprite.TradeSprite(stateToChange, thisMaterial);
    }