Exemplo n.º 1
0
        private IEnumerator ChopVegetables(Chef chef, Transform chefTransform)
        {
            Vegetable vegetable = chef.GetVegetable();

            while (vegetable != null)
            {
                chefTransform.GetComponent <ChefView>().itemsHolder.GetChild(0).SetParent(chef.pUsingChoppingBoard.GetComponent <ChoppingBoard>().itemHolder);
                chef.pUsingChoppingBoard.GetComponent <ChoppingBoard>().itemHolder.GetComponent <TransformLayout>().ForcedUpdate();
                yield return(new WaitForSeconds(m_VegetableChopTime));

                PutChoppedItemInThePlate(chef, vegetable);
                vegetable = chef.GetVegetable();
            }
            chef.MoveToNextState();
        }
Exemplo n.º 2
0
        public void ShowResult(Chef chef1, Chef chef2)
        {
            gameObject.SetActive(true);
            if (chef1.pScore > chef2.pScore)
            {
                m_GameResult.text = chef1.pName + " Won!";
            }
            else if (chef1.pScore < chef2.pScore)
            {
                m_GameResult.text = chef2.pName + " Won!";
            }
            else
            {
                m_GameResult.text = "Match Tie!";
            }

            m_ScoreSaveManager.SetScore(chef1.pName, chef1.pScore);
            m_ScoreSaveManager.SetScore(chef2.pName, chef2.pScore);
            m_ScoreSaveManager.Save();

            m_UIHighScore.Show(m_ScoreSaveManager.chefsScoreData);
        }
Exemplo n.º 3
0
        public bool ReceiveSalad(Chef chef, Salad salad)
        {
            bool isCorrectSaladCombination = mSalad.Equals(salad);

            if (isCorrectSaladCombination)
            {
                if (mTimeElapsed / mWaitTime * 100 < m_DeliveryTimeInPercentageToReward)
                {
                    SpawnPowerup(chef);
                }
                chef.pScore += m_ScoreForDelivery;
                LeaveTable();
            }
            else
            {
                if (mIsAngry)
                {
                    chef.pScore -= m_ScoreForDelivery * 2;
                }
                mIsAngry = true;
            }
            return(isCorrectSaladCombination);
        }
Exemplo n.º 4
0
 private void SpawnPowerup(Chef chef)
 {
     PowerupManager.pInstance.GenerateRandomPowerup(chef);
 }