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; } } } }
public void changeActive() { switch (state) { case wallState.ACTIVE: state = wallState.INACTIVE; break; case wallState.INACTIVE: state = wallState.ACTIVE; break; } }
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; } }
void bRotate(Vector3 point) { if (_state != State.Wall) { if (buildCursor != null) { buildCursor.transform.Rotate(0, rotationStep, 0); } } else { _wall = wallState.wallCheck; } }
// 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; } }
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); }