Ejemplo n.º 1
0
    void Initialize()
    {
        DifficultySettings = GameDifficultySettings.GetPresetDifficultySettings(GameDifficultySettings.GameDifficultyType.GameDifficulty_Easy);
        if (m_CustomerManager == null)
        {
            m_CustomerManager = new CustomerManager();
            m_CustomerManager.Initialize(this);
        }

        if (m_InnManager == null)
        {
            m_InnManager = new InnManager();
            m_InnManager.Initialize(this);
        }

        if (m_UIManager == null)
        {
            m_UIManager = new UIManager();
            m_UIManager.Initialize(this);
        }

        if (m_RecipeManager == null)
        {
            m_RecipeManager = new RecipeManager();
            m_RecipeManager.Initialize(this);
        }
    }
Ejemplo n.º 2
0
    public override void OnEnterState(IStateMachineOwner owner)
    {
        if (owner.GetType() != typeof(Customer))
        {
            Object ownerObject = owner as Object;
            Debug.LogError(string.Format("{0} is not customer, cannot use ExitInnState", ownerObject.name));
            throw new System.Exception("Wrong State Usage");
        }

        Customer customer = owner as Customer;

        Debug.Log(string.Format("{0} Enter ExitInnState", customer.Data.CharacterName));

        InnManager inn = Utils.GetGameManager().GetInnManager();

        customer.MoveToLocation(inn.GetExitLocation());
    }
Ejemplo n.º 3
0
    public override void OnEnterState(IStateMachineOwner owner)
    {
        if (owner.GetType() != typeof(Customer))
        {
            Object ownerObject = owner as Object;
            Debug.LogError(string.Format("{0} is not customer, cannot use GotoSeatsState", ownerObject.name));
            throw new System.Exception("Wrong State Usage");
        }

        Customer customer = owner as Customer;

        Debug.Log(string.Format("{0} Enter GotoSeatsState", customer.Data.CharacterName));
        Utils.GetGameManager().GetUIManager().PopoutNewMessage(customer.gameObject, "Enter GotoSeatsState");

        if (customer.GetIsLeader())
        {
            InnManager innManager = Utils.GetGameManager().GetInnManager();

            Table table;
            if (innManager.QueryTable(customer, out table))
            {
                Vector3 des = table.PopOutSeats(customer);

                Blackboard leader_bb = customer.GetComponent <Blackboard>();
                leader_bb.AddOrModifyBBValue <Table>("Table", table);

                CustomerGroup group = CustomerGroup.GetGroupViaLeader(customer);

                foreach (Customer member in group._Members)
                {
                    Blackboard member_bb = member.GetComponent <Blackboard>();
                    member_bb.AddOrModifyBBValue <Table>("Table", table);
                }

                customer.MoveToLocation(des);
                _destinationSettled = true;
            }
        }
        else
        {
            //non-leader should follow leader decisions.
        }
    }