コード例 #1
0
    public void InitHero(TB_Hero tbHero, Guid uid, int iHeroNo, GameObject heroObj)
    {
        HeroObj = heroObj;

        HeroUid  = uid;
        HeroNo   = iHeroNo;
        HeroName = tbHero.mHeroName;
        HP       = tbHero.mHP;
        MaxHP    = HP;
        Atk      = tbHero.mAtk;
        Def      = tbHero.mDef;
        Speed    = tbHero.mSpeed;

        if (HeroObj != null)
        {
            Outline = HeroObj.GetComponent <Outline>();

            Ef_HP = HeroObj.transform.Find("ef_HP");
            if (Ef_HP == null)
            {
                Debug.LogError("Not Find ef_HP!");
            }

            Ef_Effect = HeroObj.transform.Find("ef_Center");
            if (Ef_Effect == null)
            {
                Debug.LogError("Not Find Ef_Effect!");
            }
        }
    }
コード例 #2
0
    public void InitHero(TB_Hero tbHero, Guid uid, int iHeroNo, bool myTeam, int sortingOrder, GameObject heroObj)
    {
        base.InitHero(tbHero, uid, iHeroNo, heroObj);

        IsMyTeam = myTeam;

        SetActionCommend();

        InitHero(sortingOrder);
    }
コード例 #3
0
ファイル: TableManager.cs プロジェクト: yabos/BattleMasters
    void LoadHeroTable()
    {
        if (DicHero != null)
        {
            return;
        }

        DicHero = new Dictionary <int, TB_Hero>();

        List <Dictionary <string, object> > data = CSVReader.Read("Table/Hero");

        for (var i = 0; i < data.Count; i++)
        {
            TB_Hero tbHero = new TB_Hero();

            tbHero.mHeroNo    = System.Convert.ToInt32(data[i]["char_ID"]);
            tbHero.mHeroName  = System.Convert.ToString(data[i]["char_Name"]);
            tbHero.mElemental = System.Convert.ToString(data[i]["elemental"]);
            tbHero.mHP        = System.Convert.ToInt32(data[i]["maxHP"]);
            tbHero.mAtk       = System.Convert.ToInt32(data[i]["ATK"]);
            tbHero.mDef       = System.Convert.ToInt32(data[i]["DEF"]);
            tbHero.mSpeed     = System.Convert.ToInt32(data[i]["speed"]);

            tbHero.mCritical_Rate       = System.Convert.ToInt32(data[i]["critical_Rate"]);
            tbHero.mCriticalDamage_Rate = System.Convert.ToInt32(data[i]["criticalDamage_Rate"]);
            tbHero.mGrowUp_TableGroupID = System.Convert.ToInt32(data[i]["growUp_TableGroupID"]);
            tbHero.mPassive_SkillID     = System.Convert.ToInt32(data[i]["passive_SkillID"]);
            tbHero.mAtk_SkillID         = System.Convert.ToInt32(data[i]["atk_SkillID"]);
            tbHero.mCut_SkillID         = System.Convert.ToInt32(data[i]["cut_SkillID"]);
            tbHero.mDod_SkillID         = System.Convert.ToInt32(data[i]["dod_SkillID"]);
            tbHero.mActive_SkillID      = System.Convert.ToInt32(data[i]["active_SkillID"]);

            tbHero.mResPath      = System.Convert.ToString(data[i]["resource_Prefab"]);
            tbHero.mChar_Illust  = System.Convert.ToString(data[i]["char_Illust"]);
            tbHero.mChar_Icon    = System.Convert.ToString(data[i]["char_Icon"]);
            tbHero.mBaseAtkEfc   = System.Convert.ToString(data[i]["BaseAtkEfc"]);
            tbHero.mBaseAtkSound = System.Convert.ToString(data[i]["BaseAtkSound"]);

            int key = tbHero.mHeroNo;
            if (DicHero.ContainsKey(key))
            {
                Debug.LogError("Already exist key. " + key.ToString());
            }

            DicHero.Add(key, tbHero);
        }
    }
コード例 #4
0
ファイル: TBManager.cs プロジェクト: yabos/BattleHit
    void LoadHeroTable()
    {
        cont_Hero = new Dictionary<int, TB_Hero>();

        StringTable st = new StringTable();

        if (false == st.Build("Table/TB_Hero")) { return; }

        int iRowCount = st.row;

        for (int x = 0; x < iRowCount; ++x)
        {
            TB_Hero tbHero = new TB_Hero();

            tbHero.mHeroNo = st.GetValueAsInt(x, "HeroNo");
            tbHero.mHP = st.GetValueAsInt(x, "HP");
            tbHero.mAtk = st.GetValueAsInt(x, "Atk");
            tbHero.mDef = st.GetValueAsInt(x, "Def");
            int iSpeed = st.GetValueAsInt(x, "Speed");
            tbHero.mSpeed = (float)iSpeed * 0.001f;
            int iBlowPower = st.GetValueAsInt(x, "BlowPower");
            tbHero.mBlowPower = (float)iBlowPower * 0.001f;
            int iBlowTolerance = st.GetValueAsInt(x, "BlowTolerance");
            tbHero.mBlowTolerance = (float)iBlowTolerance * 0.001f;
            tbHero.stResPath = st.GetValue(x, "ResPath");
            int iScale = st.GetValueAsInt(x, "Scale");
            tbHero.mScale = (float)iScale * 0.001f;

            int key = tbHero.mHeroNo;
            if (cont_Hero.ContainsKey(key))
            {
                Debug.LogError("Already exist key. " + key.ToString() );
            }

            cont_Hero.Add(key, tbHero);
        }
    }