Example #1
0
        // 获得所有棋子布局信息
        public void GetAllChessesInfo(
            out List <int> birthIDs,
            out List <Hex> positions,
            out List <int> directions,
            out List <int> campIds)
        {
            birthIDs   = new List <int> ();
            positions  = new List <Hex> ();
            directions = new List <int> ();
            campIds    = new List <int> ();

            var ccmgr =
                _MiroMgr.GetComponent <CCManager> ();
            List <MiroModelV1> models = _MiroMgr.GetMiroModels();

            foreach (MiroModelV1 m in models)
            {
                int birthId = m.GetBirthID();
                Hex pos     = ccmgr.GetHexOfModel(m);
                int dir     = ccmgr.GetDirOfModel(m);
                int campid  =
                    _MiroMgr.GetIdOfMiroModelSetting(
                        m.GetComponent <MiroV1ModelSetting> ());

                birthIDs.Add(birthId);
                positions.Add(pos);
                directions.Add(dir);
                campIds.Add(campid);
            }
        }
Example #2
0
        void GetMiroModelDynamcsCtrl()
        {
            foreach (var dynCtrl in _modelDynCtrls)
            {
                if (dynCtrl == null)
                {
                    _modelDynCtrls.Remove(dynCtrl);
                }
            }

            List <MiroModelV1> miros =
                _MiroMgr.GetMiroModels();

            foreach (var miro in miros)
            {
                MiroModelDynamicsCtrl miroDynCtrl =
                    miro.GetComponent <MiroModelDynamicsCtrl> ();
                if (miroDynCtrl != null)
                {
                    _modelDynCtrls.Add(miroDynCtrl);
                }
            }
        }