Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Our pvp mode class, travels between scenes (A,B,C)
- class PVPMode : MonoBehavior {
- list<Enemies> _enemies;
- void Awake() { DontDestroyOnLoad(this.gameobject); }
- void Update() {
- if(TenMinutesPassed()) {
- _enemies = GetNewEnemies();
- }
- }
- // we got to the scene A and clicked on pvp ui objects which got active
- public void OnPVPUIAwake(PvpUI ui)
- {
- ui.SetEnemies(_enemies);
- }
- }
- // I sit in scene A!
- class PVPStartup : MonoBehavior {
- void OnEnable() {
- findObjectOfType<PVPMode>().OnPVPUIAwake(); // could cache the value but it's not the main trouble right now
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement