예제 #1
0
    //

    // Use this for initialization
    void Awake()
    {
        UnityEventCenter.Register <MineSelectEvent>(this, 12);
        UnityEventCenter.Register <CreateUnitEvent>(this);
        UnityEventCenter.Register <ScoreEvent>(this);
        ScoreBoard.getInstance().Init(2);
    }
예제 #2
0
 void Awake()
 {
     instance    = this;
     audioSource = GetComponent <AudioSource>();
     UnityEventCenter.Register <AudioEvent>(this);
     AudioListener.volume = 5f;
 }
예제 #3
0
    // 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;
        }
    }
예제 #4
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();
 }
예제 #5
0
    // 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>());
        }
    }
예제 #6
0
 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;
 }
예제 #7
0
 void Awake()
 {
     //注册生成单位事件
     //TODO: 未完成
     UnityEventCenter.Register <SpawnEvent>(this);
 }
예제 #8
0
 private ScoreBoard()
 {
     UnityEventCenter.Register <ScoreAddEvent>(this);
 }
예제 #9
0
 public UILabel reminder;//用户提醒器
 // Use this for initialization
 void Start()
 {
     UnityEventCenter.Register <waitClickEvent>(this);
     UnityEventCenter.Register <cancelClickEvent>(this);
 }
예제 #10
0
 public UILabel scoreNow;  //当前分数
 // Use this for initialization
 void Start()
 {
     UnityEventCenter.Register <ScoreEvent>(this);
     UnityEventCenter.Register <cancelMountainEvent>(this);
     scoreNow.text = "0";
 }
예제 #11
0
 // Use this for initialization
 void Start()
 {
     UnityEventCenter.Register <ScoreAddEvent>(this);
     coin       = gameObject.GetComponent <UISprite>();
     coin.alpha = 0;
 }
예제 #12
0
 // Use this for initialization
 void Awake()
 {
     UnityEventCenter.Register <MineSelectEvent>(this);
     UnityEventCenter.Register <cancelMountainEvent>(this);
 }
예제 #13
0
 // Use this for initialization
 void Awake()
 {
     UnityEventCenter.Register <GameOverEvent>(this, 1);
     gameEndWindows.SetActive(false);
 }
예제 #14
0
 void Start()
 {
     UnityEventCenter.Register <ViewMoveEvent>(this);
     mainCamera    = this.GetComponent <Camera>().gameObject;
     cameraInitPos = mainCamera.transform.position;
 }