Beispiel #1
0
    /// <summary>
    /// 配置数据初始化
    /// </summary>
    public void Init(string vConfigText)
    {
        // 总配置转换
        TextAsset vConfigAsset = null;

        if (string.IsNullOrEmpty(vConfigText))
        {
            vConfigAsset = Resources.Load(LocalTextFilePath) as TextAsset;             // 从本地取
            vConfigText  = vConfigAsset.text;
        }
        configPackage  = JsonUtility.FromJson <GameConfig> (vConfigText);
        evidenceConfig = new EvidenceConfig(configPackage.value);
        // 读取tips
        vConfigAsset = Resources.Load(LocalTipsFilePath) as TextAsset;         // 从本地取
        vConfigText  = vConfigAsset.text;
        tipsConfig   = new TipsConfig(JsonUtility.FromJson <GameTipsConfig> (vConfigText).value);

        // Read Character Table
        vConfigAsset   = Resources.Load(LocalCharacterFilePath) as TextAsset;
        characterTable = new CharacterTable(vConfigAsset.text);

        // 内存释放
        if (vConfigAsset != null)
        {
            Resources.UnloadAsset(vConfigAsset);
        }
        isInitialized = true;
    }
Beispiel #2
0
    public void ShowIntro(string iconPath, string intro)
    {
        m_intro.text = intro;
        var cfg = EvidenceConfig.GetConfigByKey(iconPath);

        PrefabManager.Instance.SetImage(m_icon, cfg.imagePath);
    }