示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     //Gets the components required
     rooms  = GameObject.FindGameObjectWithTag("Rooms").GetComponent <RoomLists>();
     parent = GameObject.FindGameObjectWithTag("GeometryParent").transform;
     //Starts the spawn function with a slight delay to allow for conflict detection
     Invoke("Spawn", 0.1f);
 }
示例#2
0
        /// <summary>
        /// 更新部分
        /// </summary>
        private void RefreshSome(List <long> RoomsId)
        {
            Xamarin.Forms.Device.BeginInvokeOnMainThread(() =>
            {
                foreach (var RoomId in RoomsId)
                {
                    RoomModel item       = Resources.Instance.RoomsModel.Where(x => x.RoomId == RoomId).FirstOrDefault();
                    RoomStateModel model = RoomLists.Where(x => x.RoomId == RoomId).FirstOrDefault();
                    if (null == model)
                    {
                        RoomStateModel newRoomStateModel = new RoomStateModel()
                        {
                            RoomId = item.RoomId, RoomNo = item.RoomNo, UseState = (null != item.PayOrder), OrderSession = item.OrderSession, PayOrder = item.PayOrder
                        };
                        AddList(newRoomStateModel);
                    }
                    else
                    {
                        if (null != item && null != model && model.OrderSession != item.OrderSession)
                        {
                            RoomStateModel oldModel = RoomLists.Where(x => null != x.OrderSession && x.OrderSession.Equals(model.OrderSession, StringComparison.Ordinal)).FirstOrDefault();
                            int no = RoomLists.Count;


                            RoomStateModel newRoomStateModel = new RoomStateModel()
                            {
                                RoomId = item.RoomId, RoomNo = item.RoomNo, UseState = (null != item.PayOrder), OrderSession = item.OrderSession, PayOrder = item.PayOrder
                            };
                            if (null != oldModel)
                            {
                                no = RoomLists.IndexOf(oldModel);
                                ReplaceSelected(no, oldModel, newRoomStateModel);
                            }
                            else
                            {
                                AddList(newRoomStateModel, no);
                            }
                        }
                        else
                        {
                            if (null != model && item == null)
                            {
                                RoomStateModel oldModel = RoomLists.Where(x => x.OrderSession.Equals(model.OrderSession, StringComparison.Ordinal)).FirstOrDefault();
                                if (null != oldModel)
                                {
                                    RemoveSelected(oldModel);
                                }
                            }
                        }
                    }
                }

                RefreshAll(true);
            });
        }
示例#3
0
    private void Start()
    {
        roomLists = this.GetComponent <RoomLists>();
        roomTypes = new Dictionary <string, List <GameObject> >
        {
            { SAFE_ROOM, roomLists.safeRooms },
            { ROOM_01, roomLists.rooms01 },
            { ROOM_02, roomLists.rooms02 },
            { ROOM_03, roomLists.rooms03 },
            { ROOM_04, roomLists.rooms04 },
            { BOSS_ROOM, roomLists.bossRooms }
        };

        RegenerateLevel();
    }
示例#4
0
 private void Start()
 {
     rooms = GameObject.FindGameObjectWithTag("Rooms").GetComponent <RoomLists>();
     Invoke("SpawnRoom", roomSpawnTime); // Call SpawnRoom every specified amount of seconds
 }