public static Vector3 GetTerrainBornPoint(float curHeight) { if (DataReader <Scene> .Contains(MySceneManager.Instance.CurSceneID)) { Vector2 point = MapDataManager.Instance.GetPoint(MySceneManager.Instance.CurSceneID, DataReader <Scene> .Get(MySceneManager.Instance.CurSceneID).pointId); return(MySceneManager.GetTerrainPoint(point.x * 0.01f, point.y * 0.01f, curHeight)); } return(Vector3.get_zero()); }
// Use this for initialization void Start() { sceneManager = this.GetComponent <MySceneManager>(); comboTimer = this.GetComponent <ComboTimer>(); scoreText.text = "Score: " + sceneManager.score + "\nMoves: " + sceneManager.numberOfMoves + "\nCombo Timer: " + (int)comboTimer.comboEndTime ; }
void Awake() { if (null == instance) { instance = this; DontDestroyOnLoad(gameObject); _alphaImg = GetComponent <Image>(); _alphaImg.color = new Color(0f, 0f, 0f, 0f); } }
private void Start() { charManager = CharacterManager.GetInstance(); numberOfPlayers = charManager.numberOfUsers; sceneManager = MySceneManager.GetInstance(); charManager.solo = (numberOfPlayers == 1); }
public static bool GetTerrainBornPoint(float curHeight, out Vector3 result) { if (!DataReader <Scene> .Contains(MySceneManager.Instance.CurSceneID)) { result = Vector3.get_zero(); return(false); } Vector2 point = MapDataManager.Instance.GetPoint(MySceneManager.Instance.CurSceneID, DataReader <Scene> .Get(MySceneManager.Instance.CurSceneID).pointId); return(MySceneManager.GetTerrainPoint(point.x * 0.01f, point.y * 0.01f, curHeight, out result)); }
void Update() { rabit_pos = HeroRabit.lastRabit.transform.position; my_pos = this.transform.position; if (Vector3.Distance(rabit_pos, my_pos) < 1.5) { MySceneManager.loadScene("Level" + level); } }
void OnTriggerEnter(Collider collider) { var playerController = collider.GetComponent <PlayerController>(); if (playerController == null) { return; } MySceneManager.LoadScene(SceneType.Level1); }
public override void increaseLand(PlayerStatus aMyStatus, LandMass aLand, GameMaster mMaster, Action <bool> aCallback) { MySceneManager.openScene("twoChoicesQuestion", new Arg(new Dictionary <string, object>() { { "text", aLand.mIncreaseCost.ToString() + "金で" + aLand.mNameMesh.text + "を\n増資しますか" } }), null, (aArg) => { aCallback(aArg.get <bool>("answer")); }); }
// Use this for initialization void Start() { if (GetComponent <ItemOnObject> ().item.itemName == "Ladder") { sm = GameObject.Find("SceneManager").GetComponent <MySceneManager> (); } else { this.enabled = false; } }
// Update is called once per frame void Update() { if (Input.GetKeyDown(KeyCode.R) || Input.GetButtonDown("Fire2")) { MySceneManager.ReloadStage(); // this does not even like remotely belong here. } else { RegularControls(); } }
void Start() { SoundManager.Instance.playBGM(0); nextStageButton.GetComponent <Button>().onClick.AddListener(() => { GameManager.changeStage(GameManager.StageNum + 1); }); stageSelectButton.GetComponent <Button>().onClick.AddListener(() => { MySceneManager.changeScene(SceneNames.StageSelect); }); }
void Awake() { _mySceneManager = GameObject.Find("MySceneManager").GetComponent <MySceneManager> (); if (_textConnectionState == null) { _textConnectionState = GameObject.Find("TextConnectionState").GetComponent <Text> (); } // 接続 PhotonNetwork.ConnectUsingSettings("v0.1"); }
public void RequestAISnapshot(AICharacter t) { int index = MySceneManager.GetInstance().progIndex; if (index > ai_stats.Count - 1) { index = ai_stats.Count - 1; } SetAIStats(index, t); }
// Start is called before the first frame update void Start() { sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <MySceneManager>(); if (flag == "keyCard") { if (sceneManager.keyCardBrought == true) { Destroy(gameObject); } } }
//会話ウィンドウを閉じる static public void close(Action aCallback) { if (mConversationMain == null)//既に閉じられている { aCallback(); return; } mConversationMain = null; MySceneManager.closeScene("conversation", new Arg(), (_) => { aCallback(); }); }
// Start is called before the first frame update void Start() { sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <MySceneManager>(); mText = GetComponent <Text>(); //Replaced all the "^" to next line character for (int i = 0; i < texts.Length; i++) { texts[i] = texts[i].Replace('^', '\n'); } currentText = texts[0]; StartCoroutine(BuildText()); }
// Start is called before the first frame update void Start() { Subject.addObserver(new Observer("titleMain", (a) => { if (a.name == "new") { MySceneManager.changeScene("gameConfig"); } else if (a.name == "continue") { } })); }
public void MinusLight() { HaloLight.range -= AddHaloAmount; HaloLight.intensity -= AddHaloAmount; if (HaloLight.intensity <= 0) { MySceneManager MySceneManagerScript = MySceneManaObj.GetComponent <MySceneManager>(); MySceneManagerScript.RestartLevel(); } }
public void WinState() { if (charManager.solo) { sceneManager.progressionBase++; } if (sceneManager.progressionBase == 2 && charManager.solo) { MySceneManager.GetInstance().RequestLevelLoad(SceneType.prog, "GameOver"); } }
// Update is called once per frame void Update() { if (_loading == null) { return; } if (_loading.isDone) { _loading = null; MySceneManager.OnLoadingDone(); } }
void Start() { Arg tArg = MySceneManager.getArg("play"); //Arg tArg = new Arg(new Dictionary<string, object>() { { "file", "kawaikunaritai" }, { "difficult", "guru" } }); string tFileName = tArg.get <string>("file"); ScoreDifficult tDifficult = tArg.get <ScoreDifficult>("difficult"); mHandler = MyBehaviour.create <ScoreHandler>(); mHandler.load(tFileName, tDifficult); mHandler.show(new KeyTime(-3)); mHandler.changeState(new ScoreHandler.PlayState(mHandler)); }
// Start is called before the first frame update void Start() { sceneManager = GameObject.FindGameObjectWithTag("SceneManager").GetComponent <MySceneManager>(); if (flag == "drinkOffered" && sceneManager.drinkOffered == true) { sceneManager.SwitchScreen(nextIndex); } if (flag == "grabToy" && sceneManager.grabToy == true) { sceneManager.SwitchScreen(nextIndex); } }
public void back(float delay) { { StartCoroutine(sceneChange()); } IEnumerator sceneChange() { yield return(new WaitForSeconds(delay)); // reload the current scene MySceneManager.LoadPreviousScene(); } }
void Awake() { // Singleton Pattern if (instance == null) { instance = this; instance.name = "Scene Man"; } // Assign events UnityEngine.SceneManagement.SceneManager.sceneLoaded += OnSceneLoaded; }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Update() { if (Input.GetKeyDown(KeyCode.Q)) { for (int i = 0; i < unlockStages.Length; ++i) { unlockStages[i] = true; } MySceneManager.changeScene(SceneNames.StageSelect); } }
public void SwitchMapResp(short state, SwitchMapRes down = null) { try { Debug.Log("切换地图: " + down.newMapId); if (state != 0) { StateManager.Instance.StateShow(state, 0); throw new Exception("state :" + state); } if (EntityWorld.Instance.EntSelf != null && EntityWorld.Instance.ActSelf) { EntityWorld.Instance.AddPosRecord(EntityWorld.Instance.EntSelf.ID, EntityWorld.Instance.EntSelf.Actor.FixTransform.get_position(), -1); } EventDispatcher.Broadcast(SceneManagerEvent.ClearSceneDependentLogic); if (MySceneManager.IsCityWildScene(down.oldMapId) || MySceneManager.IsCityWildScene(down.newMapId)) { down.selfObj.pos = null; } if (EntityWorld.Instance.EntSelf != null) { EntityWorld.Instance.EntSelf.SetDataByMapObjInfo(down.selfObj, false, down.transformId); } if (down.oldMapId != down.newMapId || (down.oldMapId == down.newMapId && MySceneManager.IsMainScene(down.newMapId))) { this.IsSceneExist = false; this.lastSceneType = this.curSceneType; this.curSceneType = ((!MySceneManager.IsMainScene(down.newMapId)) ? SceneType.Battle : SceneType.City); Loading.Instance.OnStartLoad(down.newMapId, down.otherObjs); } else { AOIService.Instance.SetMapArrivedObj(down.otherObjs); } } catch (Exception ex) { DialogBoxUIViewModel.Instance.ShowAsConfirm("错误", string.Format("切换地图时出错 :{0} {3} {1} version: {2}", new object[] { DateTime.get_Now().ToString("yyyy/MM/dd HH:mm:ss"), down.newMapId, GameManager.Instance.GetLocalVersionsString(), state }), null, "确定", "button_orange_1", UINodesManager.T4RootOfSpecial); throw new MySceneManager.SwitchMapException(string.Concat(new object[] { "mapID:", down.newMapId, " state:", state }), ex); } }
void Awake() { if (ins == null) { ins = this; GameObject.DontDestroyOnLoad(gameObject); } else if (ins != this) { Destroy(gameObject); } }
void Start() { if (instance != null) { DestroyImmediate(this.gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); SceneManager.sceneLoaded += OnSceneLoaded; // 이벤트에 추가 }
// Start is called before the first frame update void Start() { // Maintain the same instance across the game if (instance == null) { DontDestroyOnLoad(gameObject); instance = this; } else { Destroy(gameObject); } }
void Awake () { _instance = this; //m_trialAmount = (SceneManager.sceneCountInBuildSettings - 4); // for automatic trial count for future expansion }