public ResourcesSkillData GetSkillDatas(int number)
    {
        if (resourcesSkillDatas != null)
        {
            return(resourcesSkillDatas[number]);
        }

        resourcesSkillDatas = new List <ResourcesSkillData>();

        TextAsset[] textAssets = Resources.LoadAll <TextAsset>("SkillDatas");

        for (int i = 0; i < textAssets.Length; ++i)
        {
            ResourcesSkillData data = JsonUtility.FromJson <ResourcesSkillData>(textAssets[i].ToString());
            data.skillNumber_ = i;
            resourcesSkillDatas.Add(data);
            resourcesSkillDataNames_.Add(data.skillName_);
        }

        return(resourcesSkillDatas[number]);
    }
Exemplo n.º 2
0
    public SkillData(string skillDataName)
    {
        //初期化
        addSelfParameterRanks_  = new List <AddParameterRankState>();
        addOtherParameterRanks_ = new List <AddParameterRankState>();

        addSelfAbnormalStates_  = new List <AddAbnormalTypeState>();
        addOtherAbnormalStates_ = new List <AddAbnormalTypeState>();

        effectValueType_ = new EffectValueTypeProvider();

        ResourcesSkillData data = ResourcesSkillDatasLoader.GetInstance().GetSkillDatas(skillDataName);

        skillNumber_ = data.skillNumber_;

        skillName_ = data.skillName_;

        effectValue_ = data.effectValue_;

        optionEffectTriggerRateValue_ = data.optionEffectTriggerRateValue_;
        successRateValue_             = data.successRateValue_;
        upDpValue_ = data.upDpValue_;

        playPoint_    = data.playPoint_;
        nowPlayPoint_ = playPoint_;

        elementType_            = new ElementTypeState((ElementType)data.elementType_);
        effectValueType_.state_ = (EffectValueTypeState)data.effectValueType_;

        triggerPriority_       = data.triggerPriority_;
        criticalParameterRank_ = data.criticalParameterRank_;

        if (data.effectName_ == "NoneEffect")
        {
            effectAnimeSprites_.Add(ResourcesGraphicsLoader.GetInstance().GetGraphics("SkillEffect/" + data.effectName_));
        }
        else
        {
            Sprite[] sprite = ResourcesGraphicsLoader.GetInstance().GetGraphicsAll("SkillEffect/" + data.effectName_);
            for (int i = 0; i < sprite.Length; ++i)
            {
                effectAnimeSprites_.Add(sprite[i]);
            }
            effectSound_ = ResourcesSoundsLoader.GetInstance().GetSounds("SE/SkillEffect/" + data.effectName_);
        }

        for (int i = 0; i < data.addSelfParameterRanks_.Length; ++i)
        {
            addSelfParameterRanks_.Add(
                new AddParameterRankState((AddParameterRank)data.addSelfParameterRanks_[i].addParameterRank_
                                          , data.addSelfParameterRanks_[i].value_
                                          ));
        }
        for (int i = 0; i < data.addOtherParameterRanks_.Length; ++i)
        {
            addOtherParameterRanks_.Add(
                new AddParameterRankState((AddParameterRank)data.addOtherParameterRanks_[i].addParameterRank_
                                          , data.addOtherParameterRanks_[i].value_
                                          ));
        }

        for (int i = 0; i < data.addSelfAbnormals_.Length; ++i)
        {
            addSelfAbnormalStates_.Add(new AddAbnormalTypeState((AddAbnormalType)data.addSelfAbnormals_[i].addAbnormal_));
        }
        for (int i = 0; i < data.addOtherAbnormals_.Length; ++i)
        {
            addOtherAbnormalStates_.Add(new AddAbnormalTypeState((AddAbnormalType)data.addOtherAbnormals_[i].addAbnormal_));
        }

        effectInfo_ = data.effectInfo_;
    }