示例#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();
        }
示例#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);
        }
示例#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);
        }
示例#4
0
 private void SpawnPowerup(Chef chef)
 {
     PowerupManager.pInstance.GenerateRandomPowerup(chef);
 }