Ejemplo n.º 1
0
    public void TriggerEvent(ValueType _event)
    {
        if (_event is CommandChangeResultPos)
        {
            CommandChangeResultPos command = (CommandChangeResultPos)_event;

            GetCommandChangeResultPos(command);
        }
        else if (_event is CommandChangeWorkerPos)
        {
            CommandChangeWorkerPos command = (CommandChangeWorkerPos)_event;

            GetCommandChangeWorkerPos(command);
        }
        else if (_event is CommandCompleteDish)
        {
            CommandCompleteDish command = (CommandCompleteDish)_event;

            GetCommandCompleteDish(command);
        }
        else if (_event is CommandCompleteRequirement)
        {
            CommandCompleteRequirement command = (CommandCompleteRequirement)_event;

            GetCommandCompleteRequirement(command);
        }
    }
Ejemplo n.º 2
0
    public void CompleteRequirement(CommandCompleteRequirement _command)
    {
        for (int i = 0; i < _command.resultList.Count; i++)
        {
            int index = _command.resultList[i];

            if (index > -1)
            {
                dishResultContainerArr[index].Clear();
            }
            else
            {
                dishList[-index - 1].DestroyDishResult();
            }
        }

        money.text = playerData.money.ToString();
    }
Ejemplo n.º 3
0
    private void GetCommandCompleteRequirement(CommandCompleteRequirement _command)
    {
        PlayerDataUnit unit = _command.isMine == client.clientIsMine ? mPlayerData : oPlayerData;

        unit.CompleteRequirement(_command);

        for (int i = requirementContainer.containerList.Count - 1; i > -1; i--)
        {
            RequirementUnitContainer container = requirementContainer.containerList[i];

            if (container.requirement.uid == _command.requirementUid)
            {
                requirementContainer.containerList.RemoveAt(i);

                Destroy(container.gameObject);

                break;
            }
        }
    }