Ejemplo n.º 1
0
    private void OnEnemyInit(object obj)
    {
        Dictionary <int, EnemyInstance> enemys = _battleModel.GetEnemys();

        foreach (var kv in enemys)
        {
            _dicEnemyAction.Add(kv.Key, EnemyActionReg.GetAction(kv.Value.template.nId));
        }
    }
Ejemplo n.º 2
0
    public void Awake()
    {
#if UNITY_EDITOR
        Editor = true;
#endif

        if (Inst == null)
        {
            Inst = this;
        }
        else if (Inst != null)
        {
            Destroy(this.gameObject);   //防止重复创建
            return;
        }

        _mainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
        DontDestroyOnLoad(gameObject);

        //Application.targetFrameRate = GlobalData.FRAME_RATE;
        UIConfig.defaultFont = "Microsoft YaHei";

        //GamePath.Init(Editor);
        //AssetManager.Init(Editor);
        //UIObjectFactory.SetLoaderExtension(typeof(MyGLoader));

        SoundTool soundTool = SoundTool.inst;   //提前初始化

        TemplateManager templateMgr = new TemplateManager(new TemplateList());
        templateMgr.LoadAllXml();

        WinTool.RegisteWindows();                      // 注册窗口

        EnemyActionReg.InitAction();

        CoreDebug();
    }