private void onCloseFinances() { DialogueLua.SetVariable("Tutorials",SaveGameUtils.TUTORIALS_ON); trigger = this.GetComponent<ConversationTrigger>(); GTTeam myTeam = ChampionshipSeason.ACTIVE_SEASON.getUsersTeam(); // For example, warn the user if contracts are going to expire myTeam.endRaceActions(); trigger.conversation = "Welcome Conversation"; trigger.TryStartConversation(this.transform); Destroy(endOfRaceFinances.gameObject); }
public void Awake() { DialogueLua.SetVariable("Tutorials",SaveGameUtils.TUTORIALS_ON); SaveGameUtils.setTutorialFlags(); if(!RaceEndFinances.showFinance) { DialogueLua.SetVariable("UsersCash",ChampionshipSeason.ACTIVE_SEASON.getUsersTeam().cash); trigger = this.GetComponent<ConversationTrigger>(); trigger.conversation = "Welcome Conversation"; trigger.TryStartConversation(this.transform); } else { RaceEndFinances.showFinance = false; GameObject g =NGUITools.AddChild(GameObject.Find ("UI Root").gameObject,this.endOfRaceFinancesPrefab); Debug.Log (g.name); endOfRaceFinances = g.GetComponent<EndOfRaceFinances>(); endOfRaceFinances.onCloseFinances += onCloseFinances; } }