Beispiel #1
0
    void RpcExecuteSkill(SkillSettings.Buttons mySkillType, ExecutionData myData)
    {
        print(gameObject.name + " executed skill in Client " + mySkillType.ToString());

        /*myData.isServer = false;
         * switch (mySkillType) {
         * case SkillSettings.Buttons.Q:
         *      if (QSkill != null)
         *              QSkill (myData);
         *      break;
         * case SkillSettings.Buttons.W:
         *      if (WSkill != null)
         *              WSkill (myData);
         *      break;
         * case SkillSettings.Buttons.E:
         *      if (ESkill != null)
         *              ESkill (myData);
         *      break;
         * case SkillSettings.Buttons.R:
         *      if (RSkill != null)
         *              RSkill (myData);
         *      break;
         * }*/

        myHero.transform.LookAt(myData.executePos);
    }
Beispiel #2
0
    void CmdExecuteSkill(SkillSettings.Buttons mySkillType, Vector3 executePos, GameObject target)
    {
        print(gameObject.name + " executed skill in Server " + mySkillType.ToString());
        ExecutionData myData = new ExecutionData(true, myHero.transform.position, executePos, executePos.Floorize() - myHero.transform.position.Floorize(), target);

        switch (mySkillType)
        {
        case SkillSettings.Buttons.Q:
            if (QSkill != null)
            {
                QSkill(myData);
            }
            break;

        case SkillSettings.Buttons.W:
            if (WSkill != null)
            {
                WSkill(myData);
            }
            break;

        case SkillSettings.Buttons.E:
            if (ESkill != null)
            {
                ESkill(myData);
            }
            break;

        case SkillSettings.Buttons.R:
            if (RSkill != null)
            {
                RSkill(myData);
            }
            break;
        }
        RpcExecuteSkill(mySkillType, myData);

        myHero.transform.LookAt(myData.executePos);
    }