Exemplo n.º 1
0
    private IEnumerator DoDamage(UnitBase unit)
    {
        unit.GetDamage(attackPower);
        yield return(new WaitForSeconds(1f));

        isMove = false;
        OnMoveCompletedCall();
    }
 protected virtual void DamageFunc(UnitBase unitBase)
 {
     if (MultyManager.Inst != null)
     {
         if (unitBase.photonView != null && !unitBase.photonView.isMine)
         {
             unitBase.photonView.RPC("GetDamage", PhotonTargets.AllBufferedViaServer, m_nValue);
         }
     }
     else
     {
         unitBase.GetDamage(m_nValue);
     }
 }
 protected void DamageFuncMove(UnitBase unitBase, int nX)
 {
     if (MultyManager.Inst != null)
     {
         if (unitBase.photonView != null && !unitBase.photonView.isMine)
         {
             unitBase.photonView.RPC("GetDamage", PhotonTargets.AllBufferedViaServer, m_nValue);
             unitBase.photonView.RPC("PanelMoveBack", PhotonTargets.AllBufferedViaServer, nX);
         }
     }
     else
     {
         unitBase.GetDamage(m_nValue);
         unitBase.PanelMoveBack(nX);
     }
 }
Exemplo n.º 4
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.GetComponent <UnitBase>() == null)
        {
            return;
        }
        UnitBase pBase = collider.GetComponent <UnitBase> ();

        if (pBase != m_Unit)
        {
            if (pBase.GetType() == m_Unit.GetType())
            {
                return;
            }
        }

        pBase.GetDamage(m_Unit.GetAttackBase().nDmg);
        PooledThis();
    }
Exemplo n.º 5
0
        private void DebugText(UnitBase unit, UnitBase selection)
        {
            float  damage      = unit.GetDamage();
            float  extraDamage = 0.0f;
            string damagetext  = damage.ToString() + "(" + "+" + extraDamage.ToString() + ")";

            if (unit.attackType == selection.weaknessType)
            {
                extraDamage = (damage * (selection.weaknessPercentage / 100.0f));
                damagetext  = damage.ToString() + "(" + "+" + extraDamage.ToString() + ")";
            }
            if (unit.attackType == selection.resistanceType)
            {
                extraDamage = damage * (selection.resistancePercentage / 100.0f);
                damagetext  = damage.ToString() + "(" + "-" + extraDamage.ToString() + ")";
            }

            string temp = "\r\n" + unit.name + " Attacking: " + selection.name + " For " + damagetext + " DAMAGe";

            this._controller.uiComponent.ChangeDebugText(temp);
        }
    void OnTriggerEnter(Collider collider)
    {
        UnitBase pBase = collider.GetComponent <UnitBase> ();

        if (pBase != null)
        {
            if (pBase.GetType() != m_Unit.GetType())
            {
                pBase.GetDamage(m_nValue);
                m_goEffect.SetActive(false);
                m_goEffect.SetActive(true);
                StopCoroutine(ExecuteCoroutine());
                Invoke("PooledThis", 0.5f);
                return;
            }
        }

        Panel pCol = collider.transform.GetComponent <Panel> ();

        if (pCol != null)
        {
            int nX = pCol.GetPoint().nX;
            int nZ = pCol.GetPoint().nZ;

            if (PhotonNetwork.room != null)
            {
                ChangePanelColor(pCol, nX, nZ);
            }
            else
            {
                ChangePanelColor(pCol);
            }
        }

        StopCoroutine(ExecuteCoroutine());
        Invoke("PooledThis", 0.25f);
    }