private void TryToPlaceAWall() { //GameBoard.PlayerEnum player = controller.GetWhoseTurn(); if (interfaceController.RecordLocalPlayerMove(name)) { GameObject wall = GetUnusedWall(); MoveWallsProgramatically moveWallsProgramatically = wall.GetComponent <MoveWallsProgramatically>(); wall.transform.localScale = moveWallsProgramatically.GetWallSize(this.transform.localScale); moveWallsProgramatically.SetTarget(this.transform.position, this.transform.localScale); moveWallsProgramatically.moveWall = true; moveWallsProgramatically.SetIsOnBoard(true); eventManager.InvokeLocalPlayerMoved(); wallPlacedHere = true; } else { // Invalid move } }
public void MoveOpponentWallInGUI(string colliderName) { GameObject wall = GetUnusedOpponentWall(); Collider collider = GetCollider(colliderName); if (wall != null && collider != null) { TriggerOpponentWallIndicatorAnimation(); //wall.transform.localScale = collider.transform.localScale; MoveWallsProgramatically moveWallsProgramatically = wall.GetComponent <MoveWallsProgramatically>(); MoveArms moveArms = GameObject.Find("ScientistArmTwo").GetComponent <MoveArms>(); wall.transform.localScale = moveWallsProgramatically.GetWallSize(collider.transform.localScale); moveWallsProgramatically.SetTarget(collider.transform.position, collider.transform.localScale); moveArms.moveArm = true; moveWallsProgramatically.moveWall = true; moveWallsProgramatically.SetIsOnBoard(true); collider.GetComponent <WallPlacement>().SetWallPlacedHere(true); SwitchTurnIndicatorToLocal(); } }