コード例 #1
0
ファイル: CubeCell.cs プロジェクト: BATTLEHAWK00/MyFirstGame
 public void OnPointerExit(PointerEventData eventData)
 {
     if (UnitSelection.Get().GetStart() != this && UnitSelection.Get().GetEnd() != this)
     {
         meshRenderer.material = NormalMaterial;
     }
     name = string.Format("CubeCell({0},{1})", Position.x, Position.y);
 }
コード例 #2
0
ファイル: CubeCell.cs プロジェクト: BATTLEHAWK00/MyFirstGame
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (UnitSelection.Get().GetStart() != this && UnitSelection.Get().GetEnd() != this)
     {
         meshRenderer.material = HighLightedMaterial;
     }
     AudioManager.Get().PlaySound("Grid/OnMouse", 0.1f);
     name = name + "(OnHovering)";
 }
コード例 #3
0
 public void CellSelected(CubeCell cubeCell)
 {
     CurrentSelected = cubeCell;
     //Debug.Log("单元格选中:" + cubeCell.Position.x + "," + cubeCell.Position.y);
     if (cubeCell.CurrentUnit != null)
     {
         return;
     }
     UnitSelection.Get().ClearSelection();
     UIManager.Get().PushPanel(PanelTypes.UnitGenerationPanel);
 }
コード例 #4
0
    IEnumerator DT_MoveTo(UnitBase from, UnitBase target)
    {
        if (from == null || target == null)
        {
            yield break;
        }
        UnitSelection.Get().Waiting = true;
        Vector3 currentpositon      = from.transform.position;
        Vector3 targetpositon       = target.transform.position;

        yield return(from.transform.DOMove(targetpositon, 0.4f).WaitForCompletion());

        target.CostHP(from.Damage);
        ResManager.Get().LoadAsync <GameObject>("Prefabs/VFX/ParticleExplosion/ParticleExplosion", (vfx) => {
            vfx.transform.position = from.transform.position;
        });
        target.Anim_OnDamage();
        Camera.main.transform.DOShakePosition(0.2f, 0.05f, 20, default, default, false);
コード例 #5
0
ファイル: CubeCell.cs プロジェクト: BATTLEHAWK00/MyFirstGame
 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);
 }
コード例 #6
0
    public void Select()
    {
        Buff.Buff buff;
        switch (dropDown.value)
        {
        case 0: buff = new Buff.Heal(3, 1); break;

        case 1: buff = new Buff.Poison(3, 1); break;

        case 2: buff = new Buff.LightShield(3); break;

        case 3: buff = new Buff.MultiAttack(3); break;

        case 4: buff = new Buff.Triumph(3); break;

        default: buff = null; break;
        }
        if (buff != null)
        {
            UnitSelection.Get().GetStart().CurrentUnit.AddBuff(buff);
        }
        Cancel();
    }
コード例 #7
0
ファイル: _Debug.cs プロジェクト: BATTLEHAWK00/MyFirstGame
 public void ForceToDie()
 {
     UnitSelection.Get().GetStart().CurrentUnit.ForceDie();
 }