public void UpdateScore() { score = score + Mathf.Abs(Mathf.RoundToInt(mySpeed)) * 10; GameScreenUI gameScreenUI = GameObject.FindObjectOfType(typeof(GameScreenUI)) as GameScreenUI; Score.text = score.ToString(); }
public override void Init(params object[] inputs) { double t = Network.time; double t1 = Network.time; base.Init(inputs); // Init PoolManager MyPoolManager.Init(); // Debug.Log("MyPoolManager.Init load in " + (Network.time - t)); t = Network.time; // Add camera child = (GameObject)Instantiate(Resources.Load(commonPrefabPath + "MainCamera")); child.name = "MainCamera"; child.transform.parent = thisTransform; screenCamera = child.camera; // Debug.Log("MainCamera load in " + (Network.time - t)); // Add UI manager gameScreenUI = MyPoolManager.Spawn("GameScreenUI").GetComponent<GameScreenUI>(); gameScreenUI.transform.parent = thisTransform; gameScreenUI.Init(); // Add Controller child = (GameObject)Instantiate(Resources.Load(prefabPath + "Controller")); child.name = "Controller"; child.transform.parent = thisTransform; controller = child.GetComponent<Controller>(); // Add BulletManager bulletManager = new GameObject("Bullet Manager", typeof(BulletManager)).GetComponent<BulletManager>(); bulletManager.transform.parent = thisTransform; bulletManager.Init(controller); controller.Init(bulletManager); Resources.UnloadUnusedAssets(); // Debug.Log("gameScreen load in " + (Network.time - t1)); }
public void Init() { Instance = this; listBullets = new List<BulletUI>(); AddBullet(Bullet.Type.NORMAL, 100); }