示例#1
0
    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;
            }
        }
    }
示例#2
0
    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");
    }
示例#3
0
    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;
            }
        }
    }
示例#4
0
 private void OnFurnitureListUpdate(Furniture[] furnitures)
 {
     arrangedChairs = OwnerFloor.GetFurnitures <Chair>();
 }