Post by cursedereaper on Jun 11, 2019 3:30:14 GMT
Hey everybody,
long Story short. I made a script that was meant to make Events work better among different prefabs. And when I try to use it on my Inventory it suddenly prevents the Inventory from resetting the original Time Scale.
Long Story.
I made this script that allows me to acces my character switch script with events on a prefabs without needing to make an actual connection between the Prefab and the Character Switch.
When I put it on my v3DPersonCharacter and try to e.g. deactivate the script when I start a TriggerAction it works just fine.
But I also wanted to deactivate the script with my Inventory with the Open event and deactivate it with the close event.
The Event actually works fine and does what it should. But If I use the remote script on the Inventory and try to close it the Game is still frozen.
Any Suggestions why my Script prevents the vInventory from resetting my Original Time Scale?
My Script as a Reverence:
long Story short. I made a script that was meant to make Events work better among different prefabs. And when I try to use it on my Inventory it suddenly prevents the Inventory from resetting the original Time Scale.
Long Story.
I made this script that allows me to acces my character switch script with events on a prefabs without needing to make an actual connection between the Prefab and the Character Switch.
When I put it on my v3DPersonCharacter and try to e.g. deactivate the script when I start a TriggerAction it works just fine.
But I also wanted to deactivate the script with my Inventory with the Open event and deactivate it with the close event.
The Event actually works fine and does what it should. But If I use the remote script on the Inventory and try to close it the Game is still frozen.
Any Suggestions why my Script prevents the vInventory from resetting my Original Time Scale?
My Script as a Reverence:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class vTPS_Interactions : MonoBehaviour {
public vTPS_CharacterSwitcher cs;
// Use this for initialization
void Start () {
if (cs == null){
InitCS ();
}
}
public void InitCS()
{
if (cs == null) {
vTPS_CharacterSwitcher csSearch = (vTPS_CharacterSwitcher)FindObjectOfType(typeof(vTPS_CharacterSwitcher));
cs = csSearch;
}
}
public void lockTPSRemote ()
{
cs.lockTPS ();
}
public void unlockTPSRemote ()
{
cs.unlockTPS ();
}
public void SwitchCharacter ()
{
if (cs.CSLocks == 0 && !cs.lockCharacterSwitch)
{cs.SwitchCharacter ();}
}
public void SwitchCharacterIgnoreLock ()
{
cs.SwitchCharacter ();
}
// Update is called once per frame
// void Update () {
//
// }
}