Exemple #1
0
    void BasicInfo(GuardianUIData gfData)
    {
        GUI.Label(infoRects[0], "Def Powers:", bStyle);
        GUI.Label(infoRects[1], "Damage:", bStyle);
        GUI.Label(infoRects[2], "Move Range:", bStyle);
        GUI.Label(infoRects[3], "Atk Range:", bStyle);
        GUI.Label(infoRects[4], "Skill Rate:", bStyle);
        GUI.Label(infoRects[5], "Critical Rate:", bStyle);
        GUI.Label(infoRects[6], "Summon Cost:", bStyle);
        GUI.Label(infoRects[7], "CD Rounds:", bStyle);
        GUI.Label(infoRects[8], "Pessive:", bStyle);
        if (gfData != null)
        {
            CharacterProperty property = gfData.Chess.GetComponent <CharacterProperty>();
            CharacterPassive  passive  = gfData.Chess.GetComponent <CharacterPassive>();
            Texture2D         bigIcon  = property.BigIcon;
            GUI.DrawTexture(bigIconRect, bigIcon);
            GUI.Label(nameRect, property.NameString, gStyle);
            //statics
            GUI.Label(staticRects[0], property.defPower.ToString(), bStyle);
            GUI.Label(staticRects[1], property.atkPower.ToString(), bStyle);
            GUI.Label(staticRects[2], property.moveRange.ToString(), bStyle);
            GUI.Label(staticRects[3], property.atkRange.ToString(), bStyle);
            GUI.Label(staticRects[4], property.SkillRate.ToString(), bStyle);
            GUI.Label(staticRects[5], property.CriticalhitChance.ToString(), bStyle);
            GUI.Label(staticRects[6], property.summonCost.ToString(), bStyle);
            GUI.Label(staticRects[7], property.StandByRounds.ToString(), bStyle);

            if (passive.PassiveAbility.Length > 0)
            {
                for (int i = 0; i < passive.PassiveAbility.Length; i++)
                {
                    GUI.DrawTexture(passiveRects[i], iconVault.GetPassiveTexture(passive.PassiveAbility[i]));
                }
            }

            GUI.Label(equipRect, gfData.Skill.GetComponent <SkillProperty>().SkillName, bStyle);
        }
        if (playerData != null)
        {
            for (int i = 0; i < guardians.SkillVault.Count; i++)
            {
                GUI.Label(skillRects[i], skillArray[i].GetComponent <SkillProperty>().SkillName, bStyle);
                //roll over info
                if (skillRects[i].Contains(mousePos))
                {
                    GUI.Label(costRect, "Cost:", bStyle);
                    GUI.Label(costNumRect, skillArray[i].GetComponent <SkillProperty>().SkillCost.ToString(), bStyle);
                    GUI.TextArea(new Rect(costRect.x, costRect.y + 28.0f, 180.0f, 80.0f), skillArray[i].GetComponent <SkillProperty>().info, 500, cStyle);
                }
            }
        }
    }
 public void SetSteps(Transform chess, IList t)
 {
     Chess = chess;
     tower = GetClosetChess(Chess);
     cPass = Chess.GetComponent<CharacterPassive>();
     chessModel = chess.FindChild("Models");
     if(chessModel.GetComponent<AnimVault>()!=null){
         //chessModel.GetComponent<AnimVault>().CurrentState = AnimVault.AnimState.run;
         currentSelect.AnimStateNetWork(chess, AnimVault.AnimState.run);
     }
     int len = t.Count;
     pathList = new Transform[len];
     t.CopyTo(pathList,0);
     Step = pathList.Length-1;
     if(Step>0){
         SetDestination();
     }
 }
    public void SetSteps(Transform chess, IList t)
    {
        Chess      = chess;
        tower      = GetClosetChess(Chess);
        cPass      = Chess.GetComponent <CharacterPassive>();
        chessModel = chess.FindChild("Models");
        if (chessModel.GetComponent <AnimVault>() != null)
        {
            //chessModel.GetComponent<AnimVault>().CurrentState = AnimVault.AnimState.run;
            currentSelect.AnimStateNetWork(chess, AnimVault.AnimState.run);
        }
        int len = t.Count;

        pathList = new Transform[len];
        t.CopyTo(pathList, 0);
        Step = pathList.Length - 1;
        if (Step > 0)
        {
            SetDestination();
        }
    }
Exemple #4
0
 void updatePassive()
 {
     foreach (Transform chess in AllChesses)
     {
         if (!chess.GetComponent <CharacterProperty>().death)
         {
             CharacterPassive chessPassive = chess.GetComponent <CharacterPassive>();
             foreach (PassiveType passive in Enum.GetValues(typeof(PassiveType)))
             {
                 chessPassive.PassiveDict[passive] = false;
             }
             if ((chessPassive.PassiveAbility != null) && (chessPassive.PassiveAbility.Length > 0))
             {
                 foreach (PassiveType p in chessPassive.PassiveAbility)
                 {
                     chessPassive.PassiveDict[p] = true;
                 }
             }
         }
     }
 }
Exemple #5
0
    public void CreatedGFRollOver(Transform chess, GUIStyle style)
    {
        float             seg      = 3.0f;
        int               sq       = 16;
        CharacterProperty cp       = chess.GetComponent <CharacterProperty>();
        CharacterPassive  cpp      = chess.GetComponent <CharacterPassive>();
        Texture2D         headIcon = cp.SmallIcon;

        if (headIcon != null)
        {
            GUI.DrawTexture(posHeadIcon, headIcon);
        }
        Rect moveIcon = new Rect(30, 16, sq, sq);

        GUI.DrawTexture(moveIcon, Move[0]);
        GUI.Label(new Rect(moveIcon.x + sq + seg, moveIcon.y, sq, sq), cp.moveRange.ToString(), style);
        GUI.DrawTexture(new Rect(moveIcon.x + sq * 2 + seg * 2, moveIcon.y, sq, sq), Range[0]);
        GUI.Label(new Rect(moveIcon.x + sq * 3 + seg * 3, moveIcon.y, sq, sq), cp.atkRange.ToString(), style);
        GUI.DrawTexture(new Rect(moveIcon.x + sq * 4 + seg * 4, moveIcon.y, sq, sq), Damage[0]);
        GUI.Label(new Rect(moveIcon.x + sq * 5 + seg * 5, moveIcon.y, sq, sq), cp.atkPower.ToString(), style);
        GUI.DrawTexture(new Rect(moveIcon.x + sq * 6 + seg * 6, moveIcon.y, sq, sq), Hp[0]);
        GUI.Label(new Rect(moveIcon.x + sq * 7 + seg * 7, moveIcon.y, sq, sq), cp.defPower.ToString(), style);
        GUI.DrawTexture(new Rect(moveIcon.x + sq * 8 + seg * 8, moveIcon.y, sq, sq), Critiq[0]);
        GUI.Label(new Rect(moveIcon.x + sq * 9 + seg * 9, moveIcon.y, sq * 3, sq), cp.CriticalhitChance.ToString(), style);
        GUI.DrawTexture(new Rect(moveIcon.x + sq * 11 + seg * 10, moveIcon.y, sq, sq), Skill[0]);
        GUI.Label(new Rect(moveIcon.x + sq * 12 + seg * 11, moveIcon.y, sq * 3, sq), cp.SkillRate.ToString(), style);
        Rect posPass = new Rect(moveIcon.x + sq * 13 + seg * 12, 8, sq, sq);

        if (cpp.PassiveAbility.Length > 0)
        {
            int sg = 1; sq = 24;
            foreach (PassiveType pt in cpp.PassiveAbility)
            {
                GUI.DrawTexture(new Rect(posPass.x + sq * sg + seg * (sg - 1), posPass.y, sq, sq), GetPassiveTexture(pt));
                sg += 1;
            }
        }
    }
Exemple #6
0
    void CreateContent(Transform chess)
    {
        int  seg       = 3;
        int  texWidthA = 25;
        int  texWidthB = 35;
        int  texWidthC = 15;
        Rect startRect = new Rect();

        if (chess == leftChess)
        {
            startRect = posLeftContent;
        }
        else
        {
            startRect = posRightContent;
        }

        CharacterProperty cp  = chess.GetComponent <CharacterProperty>();
        CharacterPassive  cpp = chess.GetComponent <CharacterPassive>();

        GUI.DrawTexture(startRect, iconVault.GetIcon(BuffType.MoveRange, chess));
        Rect secCol = new Rect(startRect.x + iconWidth + seg, startRect.y - 10, 25, 30);

        GUI.Label(secCol, cp.BuffMoveRange.ToString(), numberStyle[1]);
        Rect thirdCol = new Rect(secCol.x + texWidthA, startRect.y, iconWidth, iconWidth);

        GUI.DrawTexture(thirdCol, iconVault.GetIcon(BuffType.AttackRange, chess));
        Rect forthCol = new Rect(thirdCol.x + iconWidth + seg, secCol.y, 25, 30);

        GUI.Label(forthCol, cp.BuffAtkRange.ToString(), numberStyle[1]);
        Rect fifthCol = new Rect(forthCol.x + texWidthA, startRect.y, iconWidth, iconWidth);

        GUI.DrawTexture(fifthCol, iconVault.GetIcon(BuffType.Attack, chess));
        Rect sixthCol = new Rect(fifthCol.x + iconWidth + seg, startRect.y - 24, 30, 44);

        if (cp.Damage <= 0)
        {
            cp.Damage = 0;
        }
        GUI.Label(sixthCol, cp.Damage.ToString(), numberStyle[2]);
        Rect seventhCol = new Rect(sixthCol.x + texWidthB, startRect.y, iconWidth, iconWidth);

        GUI.DrawTexture(seventhCol, iconVault.GetIcon(BuffType.Defense, chess));
        Rect eightCol = new Rect(seventhCol.x + iconWidth + seg, sixthCol.y, 50, 44);

        if (cp.Hp <= 0)
        {
            cp.Hp = 0;
        }
        GUI.Label(eightCol, cp.Hp.ToString(), numberStyle[2]);
        Rect ninthCol = new Rect(startRect.x, startRect.y + 35, iconWidth, iconWidth);

        GUI.DrawTexture(ninthCol, iconVault.GetIcon(BuffType.CriticalHit, chess));
        Rect tenthCol = new Rect(secCol.x, ninthCol.y - 4, texWidthC * 3, 24);

        if (cp.BuffCriticalHit <= 0)
        {
            cp.BuffCriticalHit = 0;
        }
        GUI.Label(tenthCol, cp.BuffCriticalHit.ToString(), numberStyle[0]);
        Rect elevthCol = new Rect(tenthCol.x + tenthCol.width, ninthCol.y, iconWidth, iconWidth);

        GUI.DrawTexture(elevthCol, iconVault.GetIcon(BuffType.SkillRate, chess));
        Rect twelvthCol = new Rect(elevthCol.x + iconWidth + seg, tenthCol.y, texWidthC * 3, 24);

        if (cp.BuffSkillRate <= 0)
        {
            cp.BuffSkillRate = 0;
        }
        GUI.Label(twelvthCol, cp.BuffSkillRate.ToString(), numberStyle[0]);
        Rect posPass = new Rect(twelvthCol.x + twelvthCol.width, elevthCol.y, iconWidth, iconWidth);

        if (cpp.PassiveAbility.Length > 0)
        {
            int sg = 0; int sq = 20;
            foreach (var pt in cpp.PassiveDict)
            {
                if (pt.Value)
                {
                    GUI.DrawTexture(new Rect(posPass.x + sq * sg + seg * (sg - 1), posPass.y, sq, sq), iconVault.GetPassiveTexture(pt.Key));
                    sg += 1;
                }
            }
        }
        if (cp.Hp <= 0)
        {
            GUI.DrawTexture(new Rect(startRect.x, startRect.y - 50, 220, 110), Dead);
        }
        if (Critical)
        {
            GUI.DrawTexture(new Rect(posLeftContent.x, posLeftContent.y - 70, 180, 90), criticalImg);
        }
        if (CriticalRight)
        {
            GUI.DrawTexture(new Rect(posRightContent.x, posRightContent.y - 70, 180, 90), criticalImg);
        }
    }
Exemple #7
0
        public static bool CheckPassive(PassiveType pt, Transform chess)
        {
            CharacterPassive chessPassive = chess.GetComponent <CharacterPassive>();

            return(chessPassive.PassiveDict[pt]);
        }
Exemple #8
0
    public void Execute()
    {
        CharacterPassive targetPassive = target.GetComponent <CharacterPassive>();

        targetPassive.PassiveDict[mode] = true;
    }