コード例 #1
0
ファイル: DoChopping.cs プロジェクト: Abhis86/SaladChef
        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
ファイル: Customer.cs プロジェクト: Abhis86/SaladChef
        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
ファイル: Customer.cs プロジェクト: Abhis86/SaladChef
 private void SpawnPowerup(Chef chef)
 {
     PowerupManager.pInstance.GenerateRandomPowerup(chef);
 }