Example #1
0
 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);
 }
Example #2
0
 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)";
 }
 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);
 }
Example #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);
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);
 }
    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();
    }
Example #7
0
 public void ForceToDie()
 {
     UnitSelection.Get().GetStart().CurrentUnit.ForceDie();
 }