Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        reactor_sound_alpha         = (Mathf.Clamp(parent_rb.velocity.magnitude, 0, 15) / 15);
        reactor_sound_emitter.pitch = reactor_sound_alpha;

        if (Input.GetButtonDown("ReactorInput") && (can_fly))
        {
            reactor_animator.SetBool("is_reactor_active", true);
            reactor_flame_particle.Play();
            reactor_smoke_particle.Play();
            can_interact_with_ore = true;
            reactor_sound_emitter.Play();
        }

        if (Input.GetButtonUp("ReactorInput") || (!can_fly))
        {
            if (can_interact_with_ore == true)
            {
                reactor_animator.SetBool("is_reactor_active", false);
                reactor_flame_particle.Stop();
                reactor_smoke_particle.Stop();
                can_interact_with_ore = false;
                reactor_sound_emitter.Stop();

                if (heatObjectScr != null)
                {
                    heatObjectScr.Stop_Heat();
                }
            }
        }
    }
Ejemplo n.º 2
0
 void OnTriggerExit2D(Collider2D col)
 {
     heatObjectScr = col.GetComponent <HeatObject>();
     if (col.gameObject.layer == 13 && can_interact_with_ore && heatObjectScr != null)
     {
         heatObjectScr.Stop_Heat();
     }
 }