public override void OnInspectorGUI() { GUIStyle myStyleBold = new GUIStyle(); myStyleBold.fontStyle = FontStyle.Bold; DrawDefaultInspector(); UpdateCards script = (UpdateCards)target; GUI.backgroundColor = Color.white; if (GUILayout.Button("Update Valeurs")) { script.Update(); } if (GUILayout.Button("Update Cards")) { script.CreateCards(); } if (GUILayout.Button("Update Lists")) { script.UpdateList(); } if (GUILayout.Button("Verify cards")) { script.VerifyThings(); } }
public void SetState(GameState gameState) { if (gameState != null) { // Reset current gamestate. Card.ResetCards(); var removedFromDeck = new List <int>(gameState.InPlay.Length + gameState.Won.Length); for (var i = 0; i < gameState.InPlay.Length; i++) { Card.FindCard(gameState.InPlay[i]).ChangeStatusTo(Position.Play); } for (var i = 0; i < gameState.Won.Length; i++) { Card.FindCard(gameState.Won[i]).ChangeStatusTo(Position.Won); } UpdateCards?.Invoke(); CalculateOptionsForAllCards(); } }