private void LinkWithSurroundingTable(Furniture furnitrue) { if (LinkedTable) { LinkedTable.UnlinkChair(this); LinkedTable = null; } var searchInfos = OwnerFloor.SearchSurroundingFurniture <Table>(this); if (searchInfos == null) { return; } foreach (var searchInfo in searchInfos) { if (searchInfo.relativeDirection == ReverseDirection && searchInfo.furniture.CurrentState == FurnitureState.Bought) { LinkedTable = searchInfo.furniture; LinkedTable.LinkChair(this); break; } } }
private void OnBuildCompleted(Furniture furnitrue) { arrangedChairs = OwnerFloor.GetFurnitures <Chair>(); OwnerFloor.onFurnitureListUpdate.AddListener(OnFurnitureListUpdate); ownerFloorBusinessSystem = OwnerFloor.GetComponent <BusinessSystem>(); GameMode.Instance.onBusinessModeStarted.AddListener(StartSpawnCustomer); GameMode.Instance.onBusinessTimeOvered.AddListener(StopSpawnCustomer); customers = Resources.LoadAll <GameObject>("NPC/Customer"); }
private void LinkWithSurroundingChairs(Furniture furnitrue) { UnlinkAllChairs(); var searchInfos = OwnerFloor.SearchSurroundingFurniture <Chair>(this); if (searchInfos == null) { return; } foreach (var searchInfo in searchInfos) { var chair = searchInfo.furniture; if (chair.CurrentState == FurnitureState.Bought && chair.CurrentDirection == searchInfo.relativeDirection) { LinkChair(chair); chair.LinkedTable = this; } } }
private void OnFurnitureListUpdate(Furniture[] furnitures) { arrangedChairs = OwnerFloor.GetFurnitures <Chair>(); }