Exemplo n.º 1
0
    public void DoubleSpeed(GameObject obj)
    {
        MalusVitesseFactor factorComp = obj.GetComponent <MalusVitesseFactor>();

        if (!IsAccel)
        {
            IsAccel = true;

            if (factorComp != null)
            {
                globalRef.Speed += factorComp.SpeedFactor;
                AccelEnCours     = factorComp.SpeedFactor;
            }
            else
            {
                globalRef.Speed += Acceleration;
                AccelEnCours     = Acceleration;
            }

            Invoke("ResetSpeed", Duree);
        }
    }
Exemplo n.º 2
0
    public void DoubleSpeed(GameObject obj)
    {
        MalusVitesseFactor factorComp = obj.GetComponent <MalusVitesseFactor>();

        this.AudioSnake.Play();

        if (!this.IsAccell)
        {
            this.IsAccell = true;

            if (factorComp != null)
            {
                globalRef.Speed  += factorComp.SpeedFactor;
                this.AccelEnCours = factorComp.SpeedFactor;
            }
            else
            {
                globalRef.Speed  += this.Acceleration;
                this.AccelEnCours = this.Acceleration;
            }

            Invoke("ResetSpeed", this.Duree);
        }
    }