private void ApplyChangeInfoSceneChange(Entity entity, SprotoType.info_item change_info)
        {
            // Debug.Log("ApplyChangeInfoSceneChange : "+change_info.value);
            string[] strs    = change_info.value.Split(',');
            int      sceneID = int.Parse(strs[0]);

            LoadingView.Instance.SetActive(true);
            LoadingView.Instance.ResetData();
            SceneMgr.Instance.LoadScene(sceneID);

            if (entity != Entity.Null)
            {
                long      new_x = Int64.Parse(strs[2]);
                long      new_y = Int64.Parse(strs[3]);
                long      new_z = Int64.Parse(strs[4]);
                Transform trans = SceneMgr.Instance.EntityManager.GetComponentObject <Transform>(entity);
                trans.localPosition = SceneMgr.Instance.GetCorrectPos(new Vector3(new_x / GameConst.RealToLogic, new_y / GameConst.RealToLogic, new_z / GameConst.RealToLogic));
                SceneMgr.Instance.EntityManager.SetComponentData(entity, new TargetPosition {
                    Value = trans.localPosition
                });
                // var uidData = SceneMgr.Instance.EntityManager.GetComponentData<UID>(entity);
                long uid = Int64.Parse(strs[1]);
                SceneMgr.Instance.EntityManager.SetComponentData <UID>(entity, new UID {
                    Value = uid
                });
                // SceneMgr.Instance.EntityManager.SetComponentData<UID>(entity);
                MoveQuery moveQuery = SceneMgr.Instance.EntityManager.GetComponentObject <MoveQuery>(entity);
                // Debug.Log("ApplyChangeInfoSceneChange new uid : "+uid+" moveQuery:"+(moveQuery!=null));
                if (moveQuery != null)
                {
                    moveQuery.ChangeUID(uid);
                }
                // var uidProxy = SceneMgr.Instance.EntityManager.GetComponentObject<UIDProxy>(entity);
                // // SceneMgr.Instance.EntityManager.SetComponentData<UID>(entity);
                // if (uidProxy!=null)
                // {
                //     long uid = Int64.Parse(strs[1]);
                //     uidProxy.Value = new UID{Value=uid};
                //     MoveQuery moveQuery = SceneMgr.Instance.EntityManager.GetComponentObject<MoveQuery>(entity);
                //     // Debug.Log("ApplyChangeInfoSceneChange new uid : "+uid+" moveQuery:"+(moveQuery!=null));
                //     if (moveQuery != null)
                //     {
                //         moveQuery.ChangeUID(uid);
                //     }
                // }
            }
        }
Exemple #2
0
 private void OnEnable()
 {
     mainRoleGOE       = RoleMgr.GetInstance().GetMainRole();
     mainRoleTrans     = mainRoleGOE.transform;
     mainRoleMoveQuery = mainRoleGOE.GetComponent <MoveQuery>();
 }