コード例 #1
0
ファイル: buildManager.cs プロジェクト: Caffcaff/BLOCWAHR1
 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;
             }
         }
     }
 }
コード例 #2
0
    public void changeActive()
    {
        switch (state)
        {
        case wallState.ACTIVE:
            state = wallState.INACTIVE;
            break;

        case wallState.INACTIVE:
            state = wallState.ACTIVE;
            break;
        }
    }
コード例 #3
0
ファイル: buildManager.cs プロジェクト: Caffcaff/BLOCWAHR1
 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;
     }
 }
コード例 #4
0
ファイル: buildManager.cs プロジェクト: Caffcaff/BLOCWAHR1
 void bRotate(Vector3 point)
 {
     if (_state != State.Wall)
     {
         if (buildCursor != null)
         {
             buildCursor.transform.Rotate(0, rotationStep, 0);
         }
     }
     else
     {
         _wall = wallState.wallCheck;
     }
 }
コード例 #5
0
ファイル: buildManager.cs プロジェクト: Caffcaff/BLOCWAHR1
 // 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;
     }
 }
コード例 #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);
    }