Topic: Prevent Guage Drain When Round Ends

How can I prevent guage drain when the round ends? I want the guage's information to carry over to the next round

Share

Thumbs up Thumbs down

Re: Prevent Guage Drain When Round Ends

I just glanced at the gauge code and found a couple variables of interest.
Let me know if this works for you.

using FPLibrary;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour
{
    private void OnEnable()
    {
        UFE.OnRoundEnds += OnRoundEnds;
    }

    private void OnDisable()
    {
        UFE.OnRoundEnds -= OnRoundEnds;
    }

    private void OnRoundEnds(ControlsScript winner, ControlsScript loser)
    {
        UFE.p1ControlsScript.gaugeDPS = (Fix64)0;
        UFE.p1ControlsScript.inhibitGainWhileDraining = false;

        UFE.p2ControlsScript.gaugeDPS = (Fix64)0;
        UFE.p2ControlsScript.inhibitGainWhileDraining = false;
    }
}

Share

Thumbs up Thumbs down

Re: Prevent Guage Drain When Round Ends

It didn't work. I attached this code to each of my character prefab. Is that where the code was supposed to be?

Share

Thumbs up Thumbs down

Re: Prevent Guage Drain When Round Ends

It doesn't really matter where you put this code, it targets both players.
I'll have to investigate more if this doesn't work.

Share

Thumbs up Thumbs down

Re: Prevent Guage Drain When Round Ends

I think I found it in FluxCapacitor.cs

In EndRound() I found

        p1ControlsScript.ResetDrainStatus(true);
        p2ControlsScript.ResetDrainStatus(true);   

I set them to (false)

Share

Thumbs up +1 Thumbs down