public CardConditionElement(ConditionDataEntry.conditions_struct data) { this.data = data; leftVariable = GlobalVariableManager.GetVar(data.variable); rightConstantValue = data.value; operation = CardConditionRule.GetOperation(data._operator); }
void Start() { continueText.SetActive(false); isPlayerOneAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_one_alive) == 1); isPlayerTwoAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_two_alive) == 1); }
void Update() { if (isPlayerAlive) { SetScoreText(GlobalVariableManager.GetIntegerVariable(playerVariable)); } }
void Start() { if (playerNumber == 1) { Vector3 playerOneColorVec = GlobalVariableManager.GetVectorVariable(VECTORVAR.player_one_color); Color playerOneColor = new Color(playerOneColorVec.x, playerOneColorVec.y, playerOneColorVec.z); if (playerSprite != null) { playerSprite.color = playerOneColor; } if (playerImage != null) { playerImage.color = playerOneColor; } } else if (playerNumber == 2) { Vector3 playerTwoColorVec = GlobalVariableManager.GetVectorVariable(VECTORVAR.player_two_color); Color playerTwoColor = new Color(playerTwoColorVec.x, playerTwoColorVec.y, playerTwoColorVec.z); if (playerSprite != null) { playerSprite.color = playerTwoColor; } if (playerImage != null) { playerImage.color = playerTwoColor; } } }
void Start() { // Remove player if not in use isValidPlayer = false; if (playerNumber == 1) { isValidPlayer = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_one_alive) == 1); } else if (playerNumber == 2) { isValidPlayer = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_two_alive) == 1); } if (!isValidPlayer) { transform.position = new Vector3(10000, 10000, 10000); } else { gridManager = GridManager.GetInstance(); gridManager.RegisterPlayer(this); gameStartAction = new UnityAction(OnGameStart); gameEndAction = new UnityAction(OnGameEnd); GameTimeManager.OnGameStart += gameStartAction; GameTimeManager.OnGameEnd += gameEndAction; } }
private void PlayTheGame() { GlobalVariableManager.SetIntegerVariable(INTEGERVAR.player_count, numPlayersAlive); GlobalVariableManager.SetIntegerVariable(INTEGERVAR.is_player_one_alive, playerOne.IsPlayerAlive() ? 1 : 0); GlobalVariableManager.SetIntegerVariable(INTEGERVAR.is_player_two_alive, playerTwo.IsPlayerAlive() ? 1 : 0); SceneManager.LoadScene(gameSceneName); }
private void Init() { csvData = GetComponent <CsvDataManager>(); csvData.Init(); variable = GetComponent <GlobalVariableManager>(); variable.Init(); condition = GetComponent <ConditionManager>(); condition.Init(); }
public override void OnInspectorGUI() { if (gvm == null || dictDrawer == null) { gvm = target as GlobalVariableManager; dictDrawer = new DictionaryEditorDrawer <string, GlobalVariable>(this, "Variables", gvm.Data, DrawVar); gvm.OnValueChanged += OnValueChanged; } DrawDefaultInspector(); dictDrawer.OnInspectorGUI(); }
void Start() { if (playerNumber == 1) { isPlayerAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_one_alive) == 1); } else if (playerNumber == 2) { isPlayerAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_two_alive) == 1); } if (!isPlayerAlive) { gameObject.SetActive(false); } }
void Start() { // Turn off player's score if not playing if (playerNumber == 1) { isPlayerAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_one_alive) == 1); } else if (playerNumber == 2) { isPlayerAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_two_alive) == 1); } if (!isPlayerAlive) { titleText.SetActive(false); gameObject.SetActive(false); } SetScoreText(0); }
void Start() { bool isPlayerOneAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_one_alive) == 1); bool isPlayerTwoAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_two_alive) == 1); int playerOneTopScore = -1; int playerTwoTopScore = -1; if (isPlayerOneAlive) { playerOneTopScore = highscores.SubmitNewScore(GlobalVariableManager.GetIntegerVariable(INTEGERVAR.player_one_score), "???"); } if (isPlayerTwoAlive) { playerTwoTopScore = highscores.SubmitNewScore(GlobalVariableManager.GetIntegerVariable(INTEGERVAR.player_two_score), "???"); } for (int i = 0; i < highscores.topScoresLimit; ++i) { string scoreStr = highscores.GetScore(i).ToString("00000"); string scoreNameStr = highscores.GetScoreName(i); if (scoreNameStr.Length == 0) { scoreNameStr = "AAA"; } char[] scoreName = scoreNameStr.ToCharArray(); scoreTexts[i].text = (i + 1) + ". " + scoreName[0] + " " + scoreName[1] + " " + scoreName[2] + " - " + scoreStr; } if (playerOneTopScore >= 0) { Vector3 colorVec = GlobalVariableManager.GetVectorVariable(VECTORVAR.player_one_color); Color color = new Color(colorVec.x, colorVec.y, colorVec.z); UpdateScore(playerOneTopScore, GlobalVariableManager.GetIntegerVariable(INTEGERVAR.player_one_score), "???", color); } if (playerTwoTopScore >= 0) { Vector3 colorVec = GlobalVariableManager.GetVectorVariable(VECTORVAR.player_two_color); Color color = new Color(colorVec.x, colorVec.y, colorVec.z); UpdateScore(playerTwoTopScore, GlobalVariableManager.GetIntegerVariable(INTEGERVAR.player_two_score), "???", color); } }
private bool SelectColor(int colorIndex) { if (!otherPlayer.IsPlayerAlive() || otherPlayer.GetPlayerSelectedColorIndex() != colorIndex) { selectedColorIndex = colorIndex; currentColorImage.color = colorImages[colorIndex].GetComponent <Image>().color; Vector3 color = new Vector3(); color.x = currentColorImage.color.r; color.y = currentColorImage.color.g; color.z = currentColorImage.color.b; GlobalVariableManager.SetVectorVariable(colorOption, color); otherPlayer.OtherPlayerSelectColor(colorIndex); return(true); } return(false); }
void Start() { inputNameIndexes.Add(0); inputNameIndexes.Add(0); inputNameIndexes.Add(0); alphabetArray = alphabet.ToCharArray(); if (playerNumber == 1) { isPlayerAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_one_alive) == 1); playerScore = GlobalVariableManager.GetIntegerVariable(INTEGERVAR.player_one_score); playerColorVec = GlobalVariableManager.GetVectorVariable(VECTORVAR.player_one_color); } else if (playerNumber == 2) { isPlayerAlive = (GlobalVariableManager.GetIntegerVariable(INTEGERVAR.is_player_two_alive) == 1); playerScore = GlobalVariableManager.GetIntegerVariable(INTEGERVAR.player_two_score); playerColorVec = GlobalVariableManager.GetVectorVariable(VECTORVAR.player_two_color); } playerColor = new Color(playerColorVec.x, playerColorVec.y, playerColorVec.z); }
public void ObtainPoints(int pointsAmount) { score += pointsAmount; GlobalVariableManager.SetIntegerVariable(playerScoreVariable, score); }
void Start() { GlobalVariableManager.SetIntegerVariable(INTEGERVAR.player_one_score, 0); GlobalVariableManager.SetIntegerVariable(INTEGERVAR.player_two_score, 0); }