示例#1
0
文件: Meet.cs 项目: hiank/tank_demo
        //private Dictionary<ulong, int> tagDic;     //NOTE: uid 转场景tag
        //private Dictionary<ulong, Item> itemMap; //NOTE: 通过uid 获得Item

        public TankManager GetTM(ulong uid)
        {
            TankManager tm = null;

            foreach (var tmp in m_Tanks)
            {
                if (uid == tmp.m_Uid)
                {
                    tm = tmp;
                    break;
                }
            }
            return(tm);
        }
示例#2
0
        public void DoMatch(WarPb.War_Match data)
        {
            m_Meet.DoMatch(data);
            //ulong uid = 2;
            //foreach (var tm in m_Meet.m_Tanks)
            //{
            //    if (uid == tm.m_Uid)
            //    {

            //        Look = tm.m_Instance.transform;
            //        break;
            //    }
            //}
            TankManager tm = m_Meet.GetTM(2002);

            if (null != tm)
            {
                Look = tm.m_Instance.transform;
            }
        }
示例#3
0
文件: Meet.cs 项目: hiank/tank_demo
        public void DoMatch(WarPb.War_Match data)
        {
            //data.MapId      //NOTE: 用于确定使用哪个地图
            //DoMatch(data, SceneManager.CreateScene("PhysicField"));

            //Scene scene = SceneManager.GetActiveScene();

            int idx = 0;

            foreach (WarPb.Team team in data.League)
            {
                foreach (MasterPb.Role role in team.Roles)
                {
                    TankManager tm = m_Tanks[idx];
                    tm.m_Instance = GameObject.Instantiate(GetPrefab(role.ModelId), tm.m_SpawnPoint.position, tm.m_SpawnPoint.rotation) as GameObject;
                    //SceneManager.MoveGameObjectToScene(tm.m_Instance, scene);
                    tm.m_Uid = role.Uid;
                    tm.Setup();
                    idx++;
                }
            }
            Physics.IgnoreLayerCollision(9, 9);
        }