public void ConfirmPressed() { if (pointsToSpend == pointsSpent) { foreach (CharacElement characElement in characElements) { string characName = characElement.CharacText; if (characName == "Strength") { uiGame.player.Strength = characElement.ValueCharac; } else if (characName == "Dexterity") { uiGame.player.Dexterity = characElement.ValueCharac; } else if (characName == "Constitution") { uiGame.player.Constitution = characElement.ValueCharac; } else if (characName == "Intelligence") { uiGame.player.Intelligence = characElement.ValueCharac; } characElement.AllocatedPoints = 0; } pointsToSpend = 0; pointsSpent = 0; if (locked) { uiGame.UnlockCharacWindow(); } uiGame.player.RecalculateCharacterStats(); uiGame.RefreshPlayerInfo(); uiGame.ToggleCrosshair(); uiGame.ToggleCharacWindow(); InputManager.Instance.UnlockKey(); TimeManager.Instance.State = TimeManager.StateGame.Running; uiGame.player.transform.Find("CamHolder/PlayerCamera").GetComponent <PlayerCamera>().ToggleCursorLock(); } }
public void CharacPressed() { uiGame.TogglePlayerInfo(); uiGame.ToggleCharacWindow(); inputMgr.LockCharacMenu(); }