Пример #1
0
    public void LoadScene(EventArgs args)
    {
        EventLoadSceneArgs loadArgs = args as EventLoadSceneArgs;

        if (loadArgs != null)
        {
            MonoHelper.GetInstance().LoadSceneAsync(loadArgs);
        }
        else
        {
            Debug.LogError("参数错误");
        }
    }
Пример #2
0
    /// <summary>
    /// 进入场景
    /// </summary>
    void OnEnterScene(byte[] p)
    {
        ProtoInt proto = ObjectPool.protoPool.GetOrCreate <ProtoInt>(ProtoPool.ProtoRecycleType.Int);

        if (proto.Parse(p))
        {
            EventLoadSceneArgs loadSceneCfg = new EventLoadSceneArgs();
            loadSceneCfg.index    = proto.context;
            loadSceneCfg.progress = null;
            loadSceneCfg.complete = SendEnterScene;
            MonoHelper.GetInstance().LoadSceneAsync(loadSceneCfg);
            proto.Recycle();
        }
    }