Beispiel #1
0
    //localstring加载回调
    private static void AssetLoadCallBack(Object target, string path)
    {
        if (null == target)
        {
            return;
        }
        TextAsset txt = target as TextAsset;

        string[] lines = txt.text.Split("\n"[0]);
        for (int i = 0; i < lines.Length; i++)
        {
            string strLine = lines[i];
            if (strLine != "")
            {
                string[] keyValue = strLine.Split(':');
                if (keyValue.Length >= 2)
                {
                    localWord[keyValue[0]] = keyValue[1].Replace("\\n", "\n").Replace("\\t", "\t");
                }
                else
                {
                    localWord[keyValue[0]] = "";
                }
            }
        }

        GameStartEvent.getInstance().dispatchEvent(GameLoadStepEvent.LOAD_WORD);
    }
Beispiel #2
0
    private void LoadDataCom(Notification note)
    {
        GameStartEvent.getInstance().removeEventListener(_stateList[_loadIndex].ToString(), LoadDataCom);
        _loadIndex++;
        if (_loadIndex >= _stateList.Count)
        {
            GameStart();
            return;
        }

        LoadDataIndex();
    }
Beispiel #3
0
    private static void LoadAssetCom(Object target, string path)
    {
        SpriteAsset spAsset = target as SpriteAsset;

        if (null != spAsset)
        {
            _spAssetDic[spAsset.ID] = spAsset;
        }
        _loadIndex++;
        if (_loadIndex >= _pathList.Count)
        {
            GameStartEvent.getInstance().dispatchEvent(GameLoadStepEvent.LOAD_FACE_ASSET);
            return;
        }
        LoadAsset();
    }
Beispiel #4
0
    //pathJson加载回调
    private static void AssetLoadCallBack(Object target, string path)
    {
        if (null == target)
        {
            return;
        }
        TextAsset    txt        = target as TextAsset;
        JsonPathMode jsonObject = JsonUtility.FromJson <JsonPathMode>(txt.text);

        foreach (var info in jsonObject.infoList)
        {
            pathDic.Add(info.key, info.path);
        }

        GameStartEvent.getInstance().dispatchEvent(GameLoadStepEvent.LOAD_PATH);
    }
Beispiel #5
0
    public override void SetVerticesDirty()
    {
        base.SetVerticesDirty();
        string outputText = GetOutputText();

        if (_outputText == outputText)
        {
            return;
        }
        _outputText = outputText;

        if (GameManager.gameInit)
        {
            UpdateQuadImage();
        }
        else
        {
            GameStartEvent.getInstance().addEventListener(GameLoadStepEvent.LOAD_COM, LoadDataCom);
        }
        //重新设置高度
        rectTransform.sizeDelta = new Vector2(rectTransform.sizeDelta.x, preferredHeight);
    }
Beispiel #6
0
 private void GameStart()
 {
     Debug.Log("GameManager GameStart");
     GameManager.gameInit = true;
     GameStartEvent.getInstance().dispatchEvent(GameLoadStepEvent.LOAD_COM);
 }
Beispiel #7
0
 private void LoadDataIndex()
 {
     Debug.Log("GameManager LoadDataIndex: " + _loadIndex);
     GameStartEvent.getInstance().addEventListener(_stateList[_loadIndex].ToString(), LoadDataCom);
     _loadFuncList[_loadIndex]();
 }
Beispiel #8
0
 //资源初始化完毕
 private void LoadDataCom(Notification note)
 {
     GameStartEvent.getInstance().removeEventListener(GameLoadStepEvent.LOAD_COM, LoadDataCom);
     UpdateQuadImage();
 }