public void Refresh(GameID game) { currentGame = game; canvasGroup.alpha = 1f; canvasGroup.blocksRaycasts = true; var gameInfo = game.GetLanguageSpecificInfo(Language.English); gameName.text = gameInfo[0].Remove(0, 4); thumbnail.texture = game.Thumbnail.texture; thumbnail.SetNativeSize(); gameDescription.text = gameInfo[1]; var difficulties = Enum.GetValues(typeof(Difficulty)) as Difficulty[]; for (var i = 0; i < difficulties.Length; i++) { stars[i].color = game.GetWinCount(difficulties[i]) > 0 ? enabledColor : disabledColor; } var playCount = difficulties.Sum(t => game.GetPlayCount(t) > 0 ? 1 : 0); bpmSlider.maxValue = Mathf.Clamp(playCount, 1, 3); difficultySlider.maxValue = Mathf.Clamp(playCount, 1, 3); }
public void OnSequenceClosed() { currentGame.Scene.UnLoad(); currentSequence.ClosingTransitionEvent.Raise(); transitionScreenAnimator.SetTrigger(fadeOutId); previousGame = null; }
public void Initialize() { currentAdvancement = 1; currentPhase = 1; phaseCountDown = phaseLength; GenerateSequence(); firstGame = currentSequence.First(); }
public bool TryGetNextGame(out GameID nextGame) { if (isRepeatable) { nextGame = game; return(true); } else { nextGame = null; return(false); } }
public bool TryGetNextGame(out GameID nextGame) { if (currentAdvancement < currentSequence.Count) { nextGame = currentSequence[currentAdvancement++]; return(true); } else { nextGame = null; return(false); } }
private IEnumerator RefreshSheetRoutine(GameID firstGame) { yield return(new WaitForEndOfFrame()); if (contentDestination.childCount > 0) { sheet.Refresh(firstGame); } else { sheet.Reset(); } }
public void ShowMenu(GameID nextGame) { if (currentgame != nextGame) { difficulty.Value = difficulty.InitialValue; speed.Value = speed.InitialValue; if (currentgame != null) { toggle.Do(); } currentgame = nextGame; icone.sprite = nextGame.Thumbnail; nomDuJeu.text = nextGame.GetLanguageSpecificInfo(Language.English)[0]; if (nextGame.GetWinCount(Difficulty.Easy) > 0) { etoiles[0].gameObject.SetActive(true); difficultyChoice[0].interactable = true; } else { etoiles[0].gameObject.SetActive(false); difficultyChoice[0].interactable = false; } if (nextGame.GetWinCount(Difficulty.Easy) > 0) { etoiles[1].gameObject.SetActive(true); difficultyChoice[1].interactable = true; } else { etoiles[1].gameObject.SetActive(false); difficultyChoice[1].interactable = false; } if (nextGame.GetWinCount(Difficulty.Hard) > 0) { etoiles[2].gameObject.SetActive(true); difficultyChoice[2].interactable = true; } else { etoiles[2].gameObject.SetActive(false); difficultyChoice[2].interactable = false; } } }
public bool TryGetNextGame(out GameID nextGame) { phaseCountDown--; if (phaseCountDown == 0) { currentPhase++; phaseCountDown = phaseLength; GenerateSequence(); } var index = -((currentPhase - 1) * phaseLength) + currentAdvancement++; nextGame = currentSequence[index]; return(true); }
protected override void OnEnable() { source = (GameID)serializedObject.targetObject; var tree = Tree; languageSpecificProperties = new InspectorProperty[] { tree.GetPropertyAtPath("titles"), tree.GetPropertyAtPath("descriptions"), tree.GetPropertyAtPath("actionVerbs") }; languagesCount = Enum.GetNames(typeof(Language)).Length; foreach (var languageSpecificProperty in languageSpecificProperties) { var array = languageSpecificProperty.ValueEntry.WeakSmartValue as string[]; Array.Resize(ref array, languagesCount); for (var i = 0; i < array.Length; i++) { if (array[i] == null) { array[i] = string.Empty; } } languageSpecificProperty.ValueEntry.WeakSmartValue = array; } rivalProperty = tree.GetPropertyAtPath("associatedRivals"); var rivalValue = (Rivals)rivalProperty.ValueEntry.WeakSmartValue; var rivals = rivalValue.Split().ToArray(); if (rivals.Length != 2) { rivalProperty.ValueEntry.WeakSmartValue = Rivals.Melo | Rivals.Theo; } designerProperty = serializedObject.FindProperty("designer"); InitializeAuthor(designerProperty); developerProperty = serializedObject.FindProperty("developer"); InitializeAuthor(developerProperty); }
public void StartNewSequence(IGameSequence newSequence) { if (!isFinished) { return; } onSequenceOpenedAtomEvent.Raise(); loadOperation = null; sequenceAdvancementAtom.SetValue(1); currentSequence = newSequence; currentSequence.OpeningTransitionEvent.Raise(); isFinished = false; currentSequence.Initialize(); currentGame = currentSequence.FirstGame; transitionScreenAnimator.SetTrigger(fadeInId); }
public void PlayNextGame() { if (isFinished) { return; } if (currentSequence.TryGetNextGame(out var newGame)) { loadOperation = null; sequenceAdvancementAtom.ApplyChange(1); previousGame = currentGame; currentGame = newGame; transitionScreenAnimator.SetTrigger(fadeInId); } else { EndCurrentSequence(); } }
public void SetupSingleSequence(GameID game) { this.game = game; isRepeatable = false; }
public void SetupRepeatableSequence(GameID game) { this.game = game; isRepeatable = true; }
private void SetCurrentGameID(GameID gameID) => currentGameID = gameID;
public void SetGameID(GameID id) { nameGame.text = id.GetLanguageSpecificInfo(Language.English)[0]; }
public void SetDisplayedGame(GameID game) => displayedGame = game;