Exemple #1
0
    /// <summary>
    /// 2つの食べ物の調理の関数
    /// 時間経過で料理に変える
    /// </summary>
    IEnumerator CookingDouble()
    {
        if (IsCooking)
        {
            if (!IsGauge)
            {
                _GaugeUIScript.SetGaugeUIPot(this.transform.position);
                IsGauge = true;
                audioCookPot.Play();
            }


            if (PotArray[0].gameObject.tag == "egg" && PotArray[1].gameObject.tag == "tmt" || PotArray[1].gameObject.tag == "egg" && PotArray[0].gameObject.tag == "tmt")
            {
                yield return(new WaitForSeconds(ConstGaugeUI.ConstUI.POT_COOKING_TIME));

                GameObject obj      = GameObject.FindGameObjectWithTag("Food");
                GameObject instance = (GameObject)Instantiate(Soup, new Vector3(this.transform.position.x + 1.0f, this.transform.position.y, this.transform.position.z), Quaternion.identity);
                instance.transform.parent = obj.transform;          //食材をfoodの子に
                obj.GetComponent <Foodselect1>().AddFood(instance.transform);
                //Debug.Log("soup");
                OpScript.CookF();
            }
            else
            {
                yield return(new WaitForSeconds(ConstGaugeUI.ConstUI.POT_COOKING_TIME));
            }

            Reset();
            audioCookPot.Stop();
            ChangeMode(Mode.Stay);
        }
    }
Exemple #2
0
    /*==================================================
    * オムライス調理メソッド関数
    *                          withコルーチン
    *  ==================================================*/
    IEnumerator CookRiceOmelet()
    {
        if (IsCookFPan)
        {
            if (!IsGauge)
            {
                CallUI.SetGaugeUIFlyingPan(this.transform.position);
                IsGauge = true;
                audioCookFP.Play();
            }
            OpScript.CookF();

            yield return(new WaitForSeconds(5));

            GameObject obj = GameObject.FindGameObjectWithTag("Food");
            // 料理の生成場所を設定できる(生成対象オブジェクト、生成座標、生成初期角度)
            GameObject instance = (GameObject)Instantiate(Omrice, new Vector3(this.transform.position.x, this.transform.position.y, this.transform.position.z), Quaternion.identity);
            instance.transform.parent = obj.transform;          //コピー食材をfoodの子に
            obj.GetComponent <Foodselect1>().AddFood(instance.transform);
            Reset();
            audioCookFP.Stop();
        }
    }