private void checkForGameEnd(GameState next) { if (next.Winner != 0) { // TODO: Does this trigger at the right time? SceneNavigation.LoadScene("GameOverScene"); } }
protected override void setAction() { onClickAction = () => { if (!sceneNav) { sceneNav = SceneNavigation.singleton; } GoToNextScene(); }; }
// Use this for initialization void Start() { Time.timeScale = 1; //pronalazi objekt tipa AudioController theAudioController = FindObjectOfType <AudioController>(); //dodjeljuje mu objekt kojem pripada mySceneNavigator = FindObjectOfType <SceneNavigation>(); //zapocnje sviranje glazbe theAudioController.PlayMenuMusic(); //pokrece ucitavanje Game scene u pozadini StartCoroutine(mySceneNavigator.LoadGameInBackgroundCo()); }
void Start() { nav = GetComponent <SceneNavigation>(); allNodes = GetComponentsInChildren <LevelNode>(); var nodes = (from node in allNodes group node by node.Name into grp select new { Name = grp.Key, Node = grp.First() }).ToDictionary(g => g.Name, g => g.Node); foreach (var sector in GameSession.CompletedSectors) { LevelNode node = null; if (nodes.TryGetValue(sector, out node)) { node.Complete(false); } } if (string.IsNullOrEmpty(GameSession.LastCompletedSector)) { var firstSector = GameSession.SECTOR_DEPENDENCIES.ElementAt(0).Key; LevelNode node = null; if (nodes.TryGetValue(firstSector, out node)) { node.Unlock(null); } } else { LevelNode node = null; if (nodes.TryGetValue(GameSession.LastCompletedSector, out node)) { node.Complete(true); } } }
void Awake() { singleton = this; }
// Start is called before the first frame update void Awake() { sceneNavigation = GetComponent <SceneNavigation>(); }
public override void Interact() => SceneNavigation.Navigate(gameObject);
protected override void GoToPrevScene() { SceneNavigation.GoToGame(); }
protected override void GoToNextScene() { SceneNavigation.GoToHome(); }