Exemplo n.º 1
0
        public override void updateProcess(float tmSlice)
        {
            if (Cache_MapChangeData != null)
            {
                //只要场景加载好了,就可以进游戏了
                if (GAMEAPI.Res_Async_Loaded())
                {
                    AnyPlotformSDK.LoadAB_Res();
                    //Debug.Log("加载完毕,进入游戏---------------------------------------------------------");

                    setChangeMapData(Cache_MapChangeData["mapid"]._uint, Cache_MapChangeData["conf"], Cache_MapChangeData["localConf"]);
                    Cache_MapChangeData = null;
                }
            }

            if (m_nScene_Loaded_CallNextFrame > 0)
            {
                m_nScene_Loaded_CallNextFrame--;
                if (0 == m_nScene_Loaded_CallNextFrame)
                {//场景加载结束
                    a3_scene_loaded();
                }
            }


            if (GAME_CAMERA == null)
            {
                GAME_CAMERA = GameObject.Find("GAME_CAMERA");
                if (GAME_CAMERA == null)
                {
                    return;
                }
                GAME_CAM_CUR    = GAME_CAMERA.transform.GetChild(0).gameObject;
                GAME_CAM_CAMERA = GAME_CAM_CUR.GetComponent <Camera>();
                LGCamera.instance.updateMainPlayerPos(true);

                LGNpcs.instance.onMapchg();
            }

            //if (fly_array.Count <= 0)
            //    return;

            //float cur_tm = this.g_mgr.g_netM.CurServerTimeStampMS;
            //for (int i = 0; i < fly_array.Count; i++)
            //{
            //    Variant fly = fly_array[i];
            //    if (fly == null)
            //        continue;
            //    float passtm = cur_tm - fly["lasttm"]._float;
            //    IGREffectParticles fly_eff = fly["fly_eff"]._val as IGREffectParticles;
            //    float flytm = fly["flytm"]._float;
            //    if (passtm >= flytm)
            //    {

            //        //到了
            //        //停止飞行特效,播放end特效
            //        if (fly_eff != null)
            //            fly_eff.stop();

            //        if (lgMainPlayer.can_play_skill_effect(0))
            //        {
            //            if (fly.ContainsKey("to_lc") && fly["end_eff"] != null && fly["to_lc"]._val != null)
            //            {
            //                LGAvatarGameInst to_lc = fly["to_lc"]._val as LGAvatarGameInst;
            //                this.dispatchEvent(
            //                    GameEvent.Create(GAME_EVENT.MAP_ADD_SHOW_EFF, this,
            //                    GameTools.createGroup("effid", fly["end_eff"]._str, "x", to_lc.x, "y", to_lc.y))
            //                );
            //            }
            //            else if (fly.ContainsKey("tar_pos") && fly["end_eff"] != null)
            //            {
            //                this.dispatchEvent(
            //                    GameEvent.Create(GAME_EVENT.MAP_ADD_SHOW_EFF, this,
            //                    GameTools.createGroup("effid", fly["end_eff"]._str, "x", (fly["tar_pos"]._val as Vec2).x, "y", (fly["tar_pos"]._val as Vec2).y))
            //                );
            //            }
            //        }
            //        fly_array._arr.RemoveAt(i);
            //        i--;
            //    }
            //    else
            //    {	//没到
            //        //更新飞行特效位置,(和方向)
            //        if (fly_eff == null)
            //            continue;
            //        float f_x = 0;
            //        float f_y = 0;

            //        if (fly.ContainsKey("to_lc"))
            //        {
            //            LGAvatarGameInst to_lc = fly["to_lc"]._val as LGAvatarGameInst;
            //            if (to_lc != null)
            //            {
            //                f_x = to_lc.x;
            //                f_y = to_lc.y;
            //            }
            //        }
            //        else if (fly.ContainsKey("tar_pos"))
            //        {
            //            Vec2 tar_pos = fly["tar_pos"]._val as Vec2;
            //            f_x = tar_pos.x;
            //            f_y = tar_pos.y;
            //        }

            //        float lx = (f_x - fly_eff.x) * (passtm / flytm);
            //        float ly = (f_y - fly_eff.y) * (passtm / flytm);
            //        fly_eff.x += lx;
            //        fly_eff.y += ly;
            //        fly["lasttm"] = cur_tm;
            //        fly["flytm"] -= passtm;
            //    }
            //}
        }