Пример #1
0
    public void Activate(float overthrust = -1)
    {
        if (Is_Malfunctioning() && this.is_online && this.active)
        {
            //if (overthrust < current_Thrust && this.IsInUse()) { return; }


            if (overthrust > -1)
            {
                current_thrust = overthrust;
            }
            if (current_thrust > settings.Thrust_start)
            {
                current_thrust = settings.Thrust_start;
            }
            fx = GetComponent <ParticleSystem>();
            fx.Play();

            ParticleSystem.ShapeModule shape = fx.shape;
            if (player_obj != null)
            {
                shape.scale = player_obj.transform.localScale;
            }

            ParticleSystem.MainModule s = fx.main;
            s.startLifetime = UnityFunctions.normValue(current_thrust + 20, 0, settings.Thrust_start);

            StartUsage();

            if (player_rb == null)
            {
                return;
            }

            UnityFunctions.Trust_At_Point(player_rb, transform, current_thrust);
        }
    }