public override void Setup()
            {
                action.icon = Instantiate(StatusIconLibrary.Get().iconTrash, StatusIconLibrary.Get().mainCanvas.transform);
                action.icon.Follow(action.gameObject);
                action.icon.StopOverlap = true;

                action.gameObject.AddComponent <OutlineHover>();
            }
            public override void Cleanup()
            {
                TableSelection tableSelection = StatusIconLibrary.Get().TableSelectionUi;

                tableSelection.SetCloseCallback(null);
                tableSelection.SetGroup(null);
                tableSelection.gameObject.SetActive(false);
                action.controller.allowUserInput = true;
            }
            public override void Setup()
            {
                //Open the Table selection screen
                action.controller.allowUserInput = false;
                TableSelection tableSelection = StatusIconLibrary.Get().TableSelectionUi;

                tableSelection.SetCloseCallback(action.OnClose);
                tableSelection.SetGroup(action.group);
                tableSelection.gameObject.SetActive(true);
            }
Ejemplo n.º 4
0
            public override void Setup()
            {
                Data.IntRange waitRange = PatienceData.Instance.waitForFood;
                action.group.Patience.Run(UnityEngine.Random.Range(waitRange.min, waitRange.max));

                action.currentIcon             = Instantiate(StatusIconLibrary.Get().iconFood, StatusIconLibrary.Get().mainCanvas.transform);
                action.currentIcon.StopOverlap = true;
                action.currentIcon.Follow(action.gameObject);
                action.currentIcon.SetPatience(action.group.Patience);
            }
Ejemplo n.º 5
0
 /// <summary>
 /// Show a Green Arrow Icon above the Orders Table
 /// </summary>
 /// <param name="show"></param>
 public void ShowDropIcon(bool show)
 {
     if (show && icon == null)
     {
         icon = Instantiate(StatusIconLibrary.Get().iconArrow, StatusIconLibrary.Get().mainCanvas.transform);
         icon.Follow(gameObject);
     }
     else if (!show && icon != null)
     {
         Destroy(icon.gameObject);
     }
 }
Ejemplo n.º 6
0
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(gameObject);
     }
 }
            public override void Setup()
            {
                if (action.photonView.isMine)
                {
                    Data.IntRange waitRange = PatienceData.Instance.waitPayBill;
                    action.group.Patience.Run(UnityEngine.Random.Range(waitRange.min, waitRange.max));
                }

                action.icon             = Instantiate(StatusIconLibrary.Get().iconMoney, StatusIconLibrary.Get().mainCanvas.transform);
                action.icon.StopOverlap = true;
                action.icon.Follow(action.gameObject);
                action.icon.SetPatience(action.group.Patience);
            }
Ejemplo n.º 8
0
            public override void Update()
            {
                if (action.ordersDesk == null)
                {
                    return;
                }

                if (Vector3.Distance(action.ordersDesk.transform.position, action.transform.position) < action.controller.actionDistance)
                {
                    StatusIconLibrary.Get().ShowTaskCompleteTick(action.ordersDesk.GetDropIcon().transform.position);
                    action.ordersDesk.photonView.RPC("AddOrder", PhotonTargets.MasterClient, action.currentOrder);
                    action.manager.RemoveAction(action);
                }
            }
            public override void Setup()
            {
                //Enter the queue
                if (action.photonView.isMine)
                {
                    action.queue.EnterQueue(action.group);

                    Data.IntRange waitRange = PatienceData.Instance.waitForTable;
                    action.group.Patience.Run(UnityEngine.Random.Range(waitRange.min, waitRange.max));
                }

                action.currentIcon = Instantiate(StatusIconLibrary.Get().iconTable, StatusIconLibrary.Get().mainCanvas.transform);
                action.currentIcon.Follow(action.gameObject);
                action.currentIcon.SetPatience(action.group.Patience);
            }
Ejemplo n.º 10
0
        public void TakeOrder(int playerViewId, PhotonMessageInfo info)
        {
            if (!PhotonNetwork.isMasterClient)
            {
                return;
            }

            Food food = null;

            if (readyFood.Count > 0)
            {
                food = readyFood.Dequeue();
            }

            PhotonView.Find(playerViewId).photonView.RPC("GiveFood", info.sender, food);
            StatusIconLibrary.Get().ShowTaskCompleteTick(icon.transform.position);
            UpdateReadyIcon();
        }
Ejemplo n.º 11
0
        private void GiveFood(Food food)
        {
            if (!PhotonNetwork.isMasterClient)
            {
                return;
            }

            if (currentStateId != stateWaitingFood)
            {
                Debug.LogError("Trying to Give Food when not in WaitingFood state.");
                return;
            }

            //TODO: Show happy/sad face
            StatusIconLibrary.Get().ShowTaskCompleteTick(currentIcon.transform.position);
            End();

            group.ActionEatFood();
        }
Ejemplo n.º 12
0
        public void Pay()
        {
            if (!photonView.isMine || currentStateId != statePay)
            {
                return;
            }

            //TODO: Increment money & score depending on satisfaction?
            StatusIconLibrary.Get().ShowTaskCompleteTick(icon.transform.position);

            //Mark the table as needing a cleanup
            if (group.Table)
            {
                group.Table.GetTable().MarkTableDirty();
            }
            group.Table = null;

            //Leave the Restaurant
            group.PlaceAtNavMesh(); //Make sure we get the customers on the NavMesh, or else they will teleport
            goToExit.SetDestination(GameObject.Find("CustomerExit").transform.position);
            SwitchState(stateLeave);
        }
        public void SetTable(int tableId)
        {
            if (!photonView.isMine)
            {
                return;
            }

            PhotonView tableObj = PhotonView.Find(tableId);

            if (tableObj == null)
            {
                Debug.LogError("Failed to find target table: " + tableId);
                return;
            }
            targetTable = tableObj.GetComponent <TableGroup>();

            //Occupy Seats
            Queue <Customer> customers = new Queue <Customer>(group.GetCustomers());

            foreach (Chair chair in targetTable.GetChairs())
            {
                if (customers.Count == 0)
                {
                    break;
                }

                if (chair.seatedCustomer == null)
                {
                    chair.seatedCustomer = customers.Dequeue();
                }
            }

            //Move Customers to their seats
            StatusIconLibrary.Get().ShowTaskCompleteTick(currentIcon.transform.position);
            goToTable.SetDestination(targetTable.transform.position);
            SwitchState(stateWalkToTable);
        }
Ejemplo n.º 14
0
        private void TakeOrder(int senderPlayerId, PhotonMessageInfo info)
        {
            if (!PhotonNetwork.isMasterClient)
            {
                return;
            }

            if (currentStateId != stateWaitingOrder)
            {
                Debug.LogError("Trying to get Order when not in WaitingOrder state.");
                return;
            }

            //Reply with order to client
            Order      order      = new Order("Test Order", group);
            PhotonView senderView = PhotonView.Find(senderPlayerId);

            senderView.RPC("ReceiveOrder", info.sender, order);

            StatusIconLibrary.Get().ShowTaskCompleteTick(currentIcon.transform.position);


            SwitchState(stateWaitingFood);
        }
Ejemplo n.º 15
0
 void Start()
 {
     //Allow the local player to select a role
     Instantiate(roleSelectPrefab, StatusIconLibrary.Get().mainCanvas.transform);
 }
Ejemplo n.º 16
0
 public override void Setup()
 {
     //TODO: Actually place the trash in the Washer?
     StatusIconLibrary.Get().ShowTaskCompleteTick(Camera.main.WorldToScreenPoint(action.washer.transform.position));
     action.End();
 }
 private void Awake()
 {
     Instance = this;
     PopulateStatusIconLibrary();
 }