示例#1
0
 private void InputTest()
 {
     if (Input.GetKeyDown(KeyCode.V))
     {
         m_CombatProps.addDamage(AttackType.Frozen, 500);
     }
     if (Input.GetKeyDown(KeyCode.B))
     {
         if (!m_CombatProps.isMess())
         {
             m_CombatProps.inMessDBuff();
         }
     }
 }
示例#2
0
    //=================================================================
    //Combat rec here
    //=================================================================
    public void recAttack(KBEngine.Role e, int attackType, float damage)
    {
        if (e.renderObj == null)
        {
            return;
        }

        GameObject player = e.renderObj as GameObject;
        GameObject dp     = (GameObject)Instantiate(damagePopupObliPref, player.transform.position, Quaternion.identity);

        dp.GetComponent <ValuePopup>().m_Player = player;
        dp.GetComponent <ValuePopup>().m_Value  = (int)damage;
        CombatProps cp = player.GetComponent <CombatProps>();

        if (cp == null)
        {
            return;
        }

        switch ((AttackType)attackType)
        {
        case AttackType.Normal:
            break;

        case AttackType.Frozen:
            if (!cp.isInFrozenDBuff)
            {
                cp.inFrozenDBuff();
            }
            break;

        case AttackType.Strong:
            if (!cp.isSleep())
            {
                Instantiate(sleepEffect, player.transform.position, player.transform.rotation, player.transform);
                cp.inSleepDBuff();
            }
            break;

        case AttackType.Shadow:
            if (!cp.isMess())
            {
                Instantiate(messEffect, player.transform.position, player.transform.rotation, player.transform);
                cp.inMessDBuff();
            }
            break;
        }
    }