コード例 #1
0
    public MonsterData(int monsterId, CampType campId, ObjectType type)
    {
        m_MonsterId       = monsterId;
        m_CampId          = campId;
        m_Type            = type;
        m_SkillList       = new List <SkillNode>();
        m_MonsterAttrNode = FSDataNodeTable <MonsterAttrNode> .GetSingleton().FindDataByType(monsterId);

        Moba3v3NaviNode naviNode = FSDataNodeTable <Moba3v3NaviNode> .GetSingleton().FindDataByType((int)type - 1);

        m_NaviPos = campId == CampType.BLUE ? new FixVector3((Fix64)naviNode.naviPoint2.x, (Fix64)naviNode.naviPoint2.y, (Fix64)naviNode.naviPoint2.z) : new FixVector3((Fix64)naviNode.naviPoint1.x, (Fix64)naviNode.naviPoint1.y, (Fix64)naviNode.naviPoint1.z);
        if (m_MonsterAttrNode == null)
        {
            return;
        }
        for (int i = 0; i < m_MonsterAttrNode.skill_id.Length; i++)
        {
            SkillNode skillNode = FSDataNodeTable <MonsterSkillNode> .GetSingleton().FindDataByType(m_MonsterAttrNode.skill_id[i]);

            m_SkillList.Add(skillNode);
        }
        m_HP = m_MaxHP = m_MonsterAttrNode.hp;
        m_MonsterModelPath    = m_MonsterAttrNode.modelNode.respath;
        m_MonsterResourceName = m_MonsterModelPath.Split('/')[3];
    }
コード例 #2
0
ファイル: PlayerData.cs プロジェクト: isoundy000/MoBaClient-1
    public PlayerData(int id, int heroId, string name, CampType campId, ObjectType type)
    {
        m_RoleId    = id;
        m_HeroId    = heroId;
        m_RoleName  = name;
        m_CampId    = campId;
        m_Type      = type;
        m_SkillList = new List <SkillNode>();
        //获取英雄品质为1的基础属性
        m_HeroAttrNode = FSDataNodeTable <HeroAttrNode> .GetSingleton().FindDataByType(heroId + 1);

        if (m_HeroAttrNode == null)
        {
            return;
        }
        for (int i = 0; i < m_HeroAttrNode.skill_id.Length; i++)
        {
            SkillNode skillNode = FSDataNodeTable <SkillNode> .GetSingleton().FindDataByType(m_HeroAttrNode.skill_id[i]);

            m_SkillList.Add(skillNode);
        }
        m_HP               = m_MaxHP = m_HeroAttrNode.hp;
        m_HeroModelPath    = m_HeroAttrNode.modelNode.respath;
        m_HeroResourceName = m_HeroModelPath.Split('/')[3];
    }
コード例 #3
0
ファイル: Resource.cs プロジェクト: moto2002/moba
    public static GameObject CreateCharacter(CharacterAttrNode attrNode, GameObject parent, Vector3 pos = default(Vector3), int groupIndex = -99)
    {
        if (attrNode == null || attrNode.model == 0)
        {
            return(null);
        }

        string modelName = attrNode.modelNode.modelPath;

        if (attrNode is HeroAttrNode && !GameLibrary.IsMajorOrLogin())
        {
            modelName = attrNode.modelNode.modelLowPath;
        }
        string modelPath = attrNode.modelNode.modelRoot;

        if (groupIndex != -99)
        {
            modelName = modelName + groupIndex;
        }
        return(CreatPrefabs(modelName, parent, pos, modelPath));
    }
コード例 #4
0
    public void RefreshUI()
    {
        LaSceneName.text = scene.SceneName;
        BtnBattle.GetComponent <BoxCollider>().enabled = true;

        CharacterAttrNode model = null;

        if (FSDataNodeTable <MonsterAttrNode> .GetSingleton().DataNodeList.ContainsKey(scene.boss))
        {
            model = FSDataNodeTable <MonsterAttrNode> .GetSingleton().DataNodeList[scene.boss];
        }
        else
        {
            model = FSDataNodeTable <HeroAttrNode> .GetSingleton().DataNodeList[scene.boss];
        }
        go = HeroPosEmbattle.instance.CreatModelByModelID(model.model, PosType.DetailPos, spinDrug, MountAndPet.Null);
        //go = HeroPosEmbattle.instance.CreatModel(model.icon_name, PosType.DetailPos, spinDrug);
        go.transform.localScale = Vector3.one * scene.model_size;

        if (scene.Type == 2)
        {
            CheckSystemTime();
            LaNeedLevel.enabled = false;
        }
        else
        {
            LaNeedLevel.enabled = true;
        }

        LaBossName.text    = scene.animationName;
        LaAdvisePower.text = "推荐战力:" + scene.fighting_capacity;
        LaCostVigor.text   = "" + scene.power_cost;
        LaNeedLevel.text   = "进入等级:[00FF21FF]" + scene.pass_lv + "级[-]";

        for (int i = SvMayRewardGrid.transform.childCount - 1; i >= 0; i--)
        {
            DestroyImmediate(SvMayRewardGrid.transform.GetChild(i).gameObject);
        }
        GameObject goMay;

        for (int i = 0; i < scene.drop.Length; i++)
        {
            if (null != scene.drop[i] && scene.drop[i] is object[])
            {
                continue;
            }
            goMay = NGUITools.AddChild(SvMayRewardGrid.gameObject, MaybeGainbg);
            goMay.GetComponent <MaybeGain>().Init(scene.drop[i]);
        }

        SvMayRewardGrid.Reposition();
        SvMayReward.ResetPosition();

        BuySweepVoucher();

        ResetEliteDungeon();

        //刷新箭头,战斗力,出战英雄
        OnConfirmLineup(true);

        SetCleanoutBtnState();

        for (int i = 0; i < WdStarConditions.Length; i++)
        {
            if (type == OpenSourceType.Dungeons)
            {
                WdStarConditions[i].RefreshUI(scene.star_describe[i], !Dungeons.ContainsKey(scene.SceneId) || Dungeons[scene.SceneId][i] > 0);
            }
            else
            {
                WdStarConditions[i].RefreshUI(scene.star_describe[i], eventStar.Count < ((scene.SceneId - scene.bigmap_id) - 1) || eventStar[(scene.SceneId - scene.bigmap_id) - 1][i] > 0);
            }
        }
    }