//functionality moved on to the GameStarter // Use this for initialization void OnLevelWasLoaded() { return; if (GoogleAPI.s != GetComponent <GoogleAPI> ()) { return; } if (SceneMaster.GetSceneID() != 3) { return; } print("onlevelwasloaded"); GameObject bg = GameObject.Find("BG"); if (bg != null) { if (GS.a.bgSprite != null) { bg.GetComponentInChildren <Image> ().sprite = GS.a.bgSprite; } if (GS.a.bgAnimation != null) { bg.GetComponentInChildren <AnimatedSpriteController> ().SetAnimation(GS.a.bgAnimation); } } try{ GameObject.Find("Daragon Text").GetComponent <Text> ().text = GS.a.startingText; GameObject.Find("Daragon Image").GetComponent <Image> ().sprite = GS.a.startingImage; }catch { } /*if (GS.a.npcSettings.isNPC) { * GameObject logic = GameObject.Find ("_Logic"); * NPCBehaviour toAdd = logic.AddComponent (GS.a.npcSettings.npcScript.GetType()) as NPCBehaviour; * logic.GetComponent<GameStarter> ().toCall [0] = toAdd; * toAdd.SelectorObject = GS.a.npcSettings.SelectorObject; * toAdd.activatePrefab = GS.a.npcSettings.activatePrefab; * toAdd.normalSelectEffect = GS.a.npcSettings.normalSelectEffect; * }*/ /*if (GS.a.npcSettings.isNPC) { * GameObject mynpc = (GameObject)Instantiate (GS.a.npcSettings.npcObject); * mynpc.GetComponent<_NPCBehaviour> ().enabled = false; * * GameObject.Find ("_Logic").GetComponent<GameStarter> ().toCall [0] = mynpc.GetComponent<_NPCBehaviour> (); * } */ if (GS.a.customObject != null) { Instantiate(GS.a.customObject); } Invoke("LateBegin", 0.1f); }
public void OnLeftRoom() { DataLogger.LogMessage("Left Room"); showingWaitingRoom = false; canPlay = true; if (SceneMaster.GetSceneID() != SceneMaster.menuId) { if (GameObjectiveMaster.s != null) { GameObjectiveMaster.s.DisconnectedFromGame(); } else { SceneMaster.s.LoadMenu(); } } else { VC_MultiplayerMenuController.SetSearchingPanelState(false); } searchingForGame = false; // display error message and go back to the menu screen gameInProgress = false; if (PlayGamesPlatform.Instance != null) { if (PlayGamesPlatform.Instance.localUser.authenticated) { canPlay = true; } //Login (); //MultiplayerMenuController.s.UpdateMenu (); } // (do NOT call PlayGamesPlatform.Instance.RealTime.LeaveRoom() here -- // you have already left the room!) }