// // Use this for initialization void Awake() { UnityEventCenter.Register <MineSelectEvent>(this, 12); UnityEventCenter.Register <CreateUnitEvent>(this); UnityEventCenter.Register <ScoreEvent>(this); ScoreBoard.getInstance().Init(2); }
void Awake() { instance = this; audioSource = GetComponent <AudioSource>(); UnityEventCenter.Register <AudioEvent>(this); AudioListener.volume = 5f; }
// Use this for initialization void Start() { UnityEventCenter.Register <ScoreEvent>(this); barNum = ScoreBoard.getInstance().playerNum; for (int i = 0; i < barNum; i++) { bars.Add(NGUITools.AddChild(gameObject, barPrefab)); bars[i].GetComponentInChildren <UISprite>().color = cs[i]; bars[i].GetComponentInChildren <UISprite>().alpha = 0.5f; bars[i].GetComponent <UIScrollBar>().value = 0; } }
// Use this for initialization void Start() { UnityEventCenter.Register <setOffEvent>(this); UnityEventCenter.Register <setVehicleEvent>(this); for (int i = 0; i < vehicleAmountUpgrd; i++)//初始化发车预选框 { GameObject vehicle = NGUITools.AddChild(vehicleCardTable.gameObject, vehicleCardPrefab); vehicle.tag = Tags.CAR_SELECTOR; vehicle.transform.localScale = new Vector3(1, 1, 1); vehicle.transform.localPosition = new Vector3(1, 1, 1); vehicle.layer = Layers.UICARD; } vehicleCardTable.Reposition(); }
// Use this for initialization void Awake() {//这里不能改动,一定只能在Awake函数里 // UnityEventCenter.Register<DestroyEvent>(this); UnityEventCenter.Register <SpawnEvent>(this); // UnityEventCenter.Register<ScoreEvent>(this); UnityEventCenter.Register <MineMoutainSpawnerEvent>(this); rm = GetComponent <AIDetector>(); GameObject[] gos = GameObject.FindGameObjectsWithTag(Tags.RAILWAY_POINT); foreach (GameObject x in gos) { rps.Add(x.GetComponent <RoadPoint>()); } }
void Start() { UnityEventCenter.Register <MineSelectEvent>(this); UnityEventCenter.Register <cancelMountainEvent>(this); sp = new List <Spawner>(); picList = new List <string>(); IDList = new List <int>(); producer = this.transform.Find("producer").GetComponent <UISprite>(); button = this.transform.Find("producer").GetComponent <UIButton>(); cdsprite = this.transform.Find("forCD").GetComponent <UISprite>(); cdsprite.fillAmount = 0.0f; CDTime = new List <float>(); isMineSelected = false; button.normalSprite = null; }
void Awake() { //注册生成单位事件 //TODO: 未完成 UnityEventCenter.Register <SpawnEvent>(this); }
private ScoreBoard() { UnityEventCenter.Register <ScoreAddEvent>(this); }
public UILabel reminder;//用户提醒器 // Use this for initialization void Start() { UnityEventCenter.Register <waitClickEvent>(this); UnityEventCenter.Register <cancelClickEvent>(this); }
public UILabel scoreNow; //当前分数 // Use this for initialization void Start() { UnityEventCenter.Register <ScoreEvent>(this); UnityEventCenter.Register <cancelMountainEvent>(this); scoreNow.text = "0"; }
// Use this for initialization void Start() { UnityEventCenter.Register <ScoreAddEvent>(this); coin = gameObject.GetComponent <UISprite>(); coin.alpha = 0; }
// Use this for initialization void Awake() { UnityEventCenter.Register <MineSelectEvent>(this); UnityEventCenter.Register <cancelMountainEvent>(this); }
// Use this for initialization void Awake() { UnityEventCenter.Register <GameOverEvent>(this, 1); gameEndWindows.SetActive(false); }
void Start() { UnityEventCenter.Register <ViewMoveEvent>(this); mainCamera = this.GetComponent <Camera>().gameObject; cameraInitPos = mainCamera.transform.position; }