private void Init() { PathSystem.Init(); if (Application.get_isPlaying() && Application.get_isEditor()) { string text = Application.get_dataPath() + "/StreamingAssets/resources2json.txt"; } Object.DontDestroyOnLoad(base.get_gameObject()); FileSystem.Init(); PreloadUIBaseSystem.Init(); GamePackets.Register(); base.InvokeRepeating("Tick", 0f, 0.03f); Loom.Current.Init(); this.InitBugly(); base.get_gameObject().AddComponent <RemoteLogSender>(); if (GameManager.IsDebug) { return; } CamerasMgr.CameraUI.set_enabled(false); this.OpenPreloadingUI(); PreloadingUIView.SetProgressName("正在初始化环境..."); Screen.set_sleepTimeout(-1); Debug.Log("SystemInfo.deviceModel = " + SystemInfoTools.GetDeviceModel()); this.CurrentUpdateManager = new UpdateManager(); this.CurrentUpdateManager.Init(); this.CheckUpdate(); }
// Start is called before the first frame update void Awake() { path.Init(transform); m_SpawnQueue = new Queue <SpawnQueueElement>(); foreach (var e in spawnEvents) { for (int i = 0; i < e.count; ++i) { SpawnQueueElement element = new SpawnQueueElement() { obj = Instantiate(e.targetToSpawn), remainingTime = e.timeBetweenSpawn }; element.rb = element.obj.GetComponent <Rigidbody>(); element.target = element.obj.GetComponentInChildren <Target>(); element.obj.SetActive(false); element.obj.transform.position = transform.position; element.obj.transform.rotation = transform.rotation; path.InitData(element.pathData); m_SpawnQueue.Enqueue(element); } } if (m_SpawnQueue.Count == 0) { Destroy(gameObject); } else { m_ActiveElements = new List <SpawnQueueElement>(); Dequeue(); } }
void Start() { path.Init(transform); path.InitData(pathData); }