Example #1
0
 void OnBorn()
 {
     //行计数器加1
     GameGlobal.Get().GameMain.GridSystem.RowCounter[GetPosition().Position.y]++;
     //添加事件
     EventAdd();
     EventManager.Get().EventTrigger(EventTypes.Unit_OnBorn, gameObject);
     //向回合系统列表添加单位
     RoundSystem.Get().AddUnit(this);
 }
Example #2
0
 void OnGameInitialize()
 {
     GameObject grid = ResManager.Get().Load<GameObject>("Prefabs/GridSystem/GridSystem");
     grid.transform.SetParent(GameObject.Find("Ground").transform, false);
     GridSystem = grid.GetComponent<GridSystem>();
     GridSystem.enabled = true;
     GridSystem.gameObject.name = "GridSystem";
     HolyWaterSystem.Get().Init();
     RoundSystem.Get().Init(1);
     UIManager.Get();
     UIManager.Get().PushPanel(PanelTypes.HUDPanel);
     //GameNetwork.Getinstance().GetNetWorkManager();
 }
Example #3
0
    void NextRound(object info)
    {
        if (text == null)
        {
            text = GetComponentInChildren <UnityEngine.UI.Text>();
        }
        uint round = RoundSystem.Get().Rounds;

        if (round % 2 == RoundSystem.Get().Side)
        {
            text.text = "回合数:" + RoundSystem.Get().Rounds.ToString() + "(你的回合)";
        }
        else
        {
            text.text = "回合数:" + RoundSystem.Get().Rounds.ToString();
        }
    }
Example #4
0
 void OnDeath()
 {
     //播放死亡音效
     AudioManager.Get().PlaySound(SoundsList.Unit_OnDeath, 0.2f);
     //广播死亡消息
     UIManager.Get().MsgOnScreen(UnitName + "已死亡!");
     //行计数器扣除
     GameGlobal.Get().GameMain.GridSystem.RowCounter[GetPosition().Position.y]--;
     //触发单位死亡事件(Unit_OnUnitDeath)
     EventManager.Get().EventTrigger(EventTypes.Unit_OnDeath, gameObject);
     //事件移除
     EventRemove();
     //解引用
     GetPosition().CurrentUnit = null;
     //移除回合系统列表
     RoundSystem.Get().RemoveUnit(this);
 }
Example #5
0
 public void OnPointerClick(PointerEventData eventData)  //鼠标点击事件
 {
     if (eventData.button != PointerEventData.InputButton.Left)
     {
         return;
     }
     if (!RoundSystem.Get().IsWaitingPlayer())
     {
         return;
     }
     EventManager.Get().EventTrigger <CubeCell>(EventTypes.Cell_OnSelected, this);
     if (this.CurrentUnit != null)
     {
         UnitSelection.Get().Set(this);
     }
     if (UnitSelection.Get().GetStart() == this)
     {
         meshRenderer.material = OccupiedMaterial;
     }
     AudioManager.Get().PlaySound("Grid/OnClick", 0.1f);
 }
Example #6
0
 public void NextRound()
 {
     RoundSystem.Get().NextRound();
 }