Exemplo n.º 1
0
 /// <summary>
 /// 初始化,此接口必须最先调用
 /// </summary>
 /// <param name="gameObject">游戏对象</param>
 /// <param name="initListener">返回初始化结果<see cref="ResultInit"/></param>
 public virtual void Init(HonorSDKGameObject gameObject, OnFinish <ResultInit> initListener, string gameResVersion, Dictionary <string, string> configs = null)
 {
     if (configs == null)
     {
         configs = new Dictionary <string, string>();
     }
     configs.Add("gameResVersion", gameResVersion);
     gameObject.SetOnReceiveListener(new OnReceiveMsg(handler.OnReceive));
     handler.RegisterCallback(Api.INIT, initListener);
     instanceImpl.Init(gameObject, initListener, gameResVersion, configs);
 }
Exemplo n.º 2
0
        public void Init(HonorSDKGameObject gameObject, OnFinish <ResultInit> initListener, string gameResVersion, Dictionary <string, string> configs = null)
        {
            JSONClass json = new JSONClass();

            foreach (KeyValuePair <string, string> kv in configs)
            {
                json.Add(kv.Key, new JSONData(kv.Value));
            }
            string configsStr = json.ToString();

            currentActivity.Call("init", gameObject.name, configs);
        }
Exemplo n.º 3
0
 public void Init(HonorSDKGameObject gameObject, OnFinish <ResultInit> initListener, string gameResVersion, Dictionary <string, string> configs = null)
 {
 }