public void MoveX(int dx) { int newX = posMarker.posX + dx; if (GridController.instance.GetBlock(newX, posMarker.posY)) { posMarker.posX = newX; posMarker.AttachToBlock(); } }
public override void OnInspectorGUI() { DrawDefaultInspector(); ItemBase myScript = (ItemBase)target; if (GUILayout.Button("Attach to Grid")) { myScript.AttachToBlock(); } }
public void BeginSetting() { GameController.instance.useLandMine = true; minePanel.SetActive(true); posMarker = Instantiate(landMineParent).GetComponent <ItemBase>(); posMarker.AttachToBlock(); GameController.instance.gamePhase = GamePhase.Presetting; if (GameController.gameMode == GameMode.LocalPVP) { buttonImage.color = GameController.instance.players[GameController.currentPlayer].playerColor.color; } else if (GameController.gameMode == GameMode.NetPVP) { buttonImage.color = GameController.instance.players[OnlinePlayer.myID].playerColor.color; } MessageManager.CreateMessage("地雷玩法启用,请布雷。"); }