Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        //着火状態小炎
        if (status.GetIgnit() && status.GetFireSize() == 1)
        {
            GetComponent <Renderer>().material = smallFireMat;
            if (!smallFireParticle.GetComponentInChildren <ParticleSystem>().isEmitting)
            {
                smallFireParticle.GetComponentInChildren <ParticleSystem>().Play();
                fireParticle.GetComponentInChildren <ParticleSystem>().Stop();
                bigFireParticle.GetComponentInChildren <ParticleSystem>().Stop();
            }
        }//中炎
        else if (status.GetIgnit() && status.GetFireSize() == 2)
        {
            GetComponent <Renderer>().material = fireMat;
            if (!fireParticle.GetComponentInChildren <ParticleSystem>().isEmitting)
            {
                fireParticle.GetComponentInChildren <ParticleSystem>().Play();
                smallFireParticle.GetComponentInChildren <ParticleSystem>().Stop();
                bigFireParticle.GetComponentInChildren <ParticleSystem>().Stop();
            }
        }//大炎
        else if (status.GetIgnit() && status.GetFireSize() == 3)
        {
            GetComponent <Renderer>().material = bigFireMat;
            if (!bigFireParticle.GetComponentInChildren <ParticleSystem>().isEmitting)
            {
                bigFireParticle.GetComponentInChildren <ParticleSystem>().Play();
                fireParticle.GetComponentInChildren <ParticleSystem>().Stop();
                smallFireParticle.GetComponentInChildren <ParticleSystem>().Stop();
            }
        }
        //鎮火状態
        else
        {
            GetComponent <Renderer>().material = normalMat;
            fireParticle.GetComponentInChildren <ParticleSystem>().Stop();
            smallFireParticle.GetComponentInChildren <ParticleSystem>().Stop();
            bigFireParticle.GetComponentInChildren <ParticleSystem>().Stop();
        }

        //カーソルあってるとき
        if (status.GetCursol())
        {
            GetComponent <Renderer>().material.color += cursolMat.color;
            status.SetCursol(false);
        }
    }
Esempio n. 2
0
 // Update is called once per frame
 void Update()
 {
     ignitStatus = gameObject.GetComponent <IgnitStatus>();
     if (ignitStatus.GetIgnit() == false)
     {
         audioSource.Play();
     }
 }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     if (status.GetIgnit())
     {
         GetComponent <Renderer>().material = fireMat;
     }
     else
     {
         GetComponent <Renderer>().material = normalMat;
     }
 }
Esempio n. 4
0
 // Update is called once per frame
 void Update()
 {
     if (modeManager == null)
     {
         return;
     }
     //火が付く条件
     if (modeManager.NowOutMode() == Osha1 && ignitStatus.GetIgnit() || modeManager.NowOutMode() == Osha2 && ignitStatus.GetIgnit())
     {
         //着火してる時に
         //外周部が0度の時   1
         //外周部が90度の時  2
         //外周部が180度の時 3
         //外周部が-90度の時 4
         if (modeManager.NowInMode() == Isha1 && ignitStatus.GetIgnit() || modeManager.NowInMode() == Isha2 && ignitStatus.GetIgnit())
         {
             GetComponent <Renderer>().material = flameMat;
             ignitStatus.SetIgnit(true);
         }
     }
 }
Esempio n. 5
0
    // Update is called once per frame
    void Update()
    {
        if (flag)
        {
            if (ignitStatus.GetIgnit() && !audioSource.isPlaying)
            {
                audioSource.Play();
            }
            else if (!ignitStatus.GetIgnit())
            {
                audioSource.Stop();
            }
            return;
        }


        if (changeStateFire != ignitStatus.GetFireSize())
        {
            switch (ignitStatus.GetFireSize())
            {
            case 0:
                audioSource.Stop();
                audioSource.clip = stopFire;
                audioSource.PlayOneShot(stopFire, 1);
                break;

            case 1:
                if (audioSource.clip != fire1)
                {
                    audioSource.Stop();
                }
                audioSource.clip = fire1;
                break;

            case 2:
                if (audioSource.clip != fire2)
                {
                    audioSource.Stop();
                }
                audioSource.clip = fire2;
                break;

            case 3:
                if (audioSource.clip != fire3)
                {
                    audioSource.Stop();
                }
                audioSource.clip = fire3;
                break;

            default:
                break;
            }

            changeStateFire = ignitStatus.GetFireSize();
        }
        if (ignitStatus.GetIgnit() && !audioSource.isPlaying)
        {
            audioSource.Play();
        }
    }
Esempio n. 6
0
    // Update is called once per frame
    void Update()
    {
        //着火時
        if (ignitStatus.GetIgnit())
        {
            //外1の時
            if (modeManager.NowInMode() == 1)
            {
                //内が
                switch (modeManager.NowOutMode())
                {
                case 1:
                    Shadow1.gameObject.SetActive(true);
                    Shadow2.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 2:
                    Shadow2.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 3:
                    Shadow3.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 4:
                    Shadow4.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    break;
                }
            }
            //内2の時
            if (modeManager.NowInMode() == 2)
            {
                //外が
                switch (modeManager.NowOutMode())
                {
                case 1:
                    Shadow4.gameObject.SetActive(true);
                    Shadow3.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow1.gameObject.SetActive(false);
                    break;

                case 2:
                    Shadow1.gameObject.SetActive(true);
                    Shadow2.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 3:
                    Shadow2.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    break;

                case 4:
                    Shadow3.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;
                }
            }
            //外3の時
            if (modeManager.NowInMode() == 3)
            {
                //内が
                switch (modeManager.NowOutMode())
                {
                case 1:
                    Shadow3.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 2:
                    Shadow4.gameObject.SetActive(true);
                    Shadow3.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow1.gameObject.SetActive(false);
                    break;

                case 3:
                    Shadow1.gameObject.SetActive(true);
                    Shadow2.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 4:
                    Shadow2.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;
                }
            }
            //外4の時
            if (modeManager.NowInMode() == 4)
            {
                //内が
                switch (modeManager.NowOutMode())
                {
                case 1:
                    Shadow2.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    break;

                case 2:
                    Shadow3.gameObject.SetActive(true);
                    Shadow1.gameObject.SetActive(false);
                    Shadow2.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;

                case 3:
                    Shadow4.gameObject.SetActive(true);
                    Shadow2.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow1.gameObject.SetActive(false);
                    break;

                case 4:
                    Shadow1.gameObject.SetActive(true);
                    Shadow2.gameObject.SetActive(false);
                    Shadow3.gameObject.SetActive(false);
                    Shadow4.gameObject.SetActive(false);
                    break;
                }
            }
        }
        else if (!ignitStatus.GetIgnit())
        {
            Shadow1.gameObject.SetActive(false);
            Shadow2.gameObject.SetActive(false);
            Shadow3.gameObject.SetActive(false);
            Shadow4.gameObject.SetActive(false);
        }
    }