Пример #1
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        Launched = Rocket.GetLaunched();

        if (!SoundPlayed && Launched)
        {
            sound01.PlayOneShot(sound01.clip);
            SoundPlayed = true;
        }
    }
Пример #2
0
    void Update()
    {
        Launched = rocketController.GetLaunched();

        if (Broken || Launched)
        {
            PumpAnimation.GetComponent <Animator>().SetBool("PumpStart", false);

            _bubbleController.StopBubble();
            return;
        }

        if (push)
        {
            Pumping();
            PumpAnimation.GetComponent <Animator>().SetBool("PumpStart", true);

            if (PumpMax > PumpPressure)
            {
                _bubbleController.StartBubble();
            }
            else
            {
                _bubbleController.StopBubble();
            }
        }
        else
        {
            PumpAnimation.GetComponent <Animator>().SetBool("PumpStart", false);

            _bubbleController.StopBubble();
        }

        if (BottolePressureMax < PumpPressure || Launched)   //破裂
        {
            ExplosionSound.PlayOneShot(ExplosionSound.clip);
            PumpPressure            = 0;
            Broken                  = true;
            rocketController.Broken = true;

            Instantiate(ExplisionPrefab, Rocket.transform.position, Rocket.transform.rotation);

            ScaleW.y = 0.0f;
            rocketController.Water.transform.localScale = ScaleW;

            Rocket.GetComponent <Rigidbody2D>().AddTorque(2.0f, ForceMode2D.Impulse);

            scoreData.ScoreNow = -10.0f;     //破裂したらマイナスポイント
            scoreData.SaveScore();

            StartCoroutine("GoScore");
        }
    }
Пример #3
0
 // Update is called once per frame
 void Update()
 {
     Launched = Rocket.GetLaunched();
     //Debug.Log("launched " + Launched);
 }