Add SetParameter function in NamedStudioEventEmitter
parent
75d6785dc6
commit
7a66f72aa8
|
@ -217,6 +217,18 @@ public class BTC : MonoBehaviour {
|
|||
}
|
||||
}
|
||||
|
||||
[Task]
|
||||
public void SetFloat(string objectName, string key, float value)
|
||||
{
|
||||
List<ComponentHandler> handlers = GetHandlers(objectName);
|
||||
handlers.ForEach(handler => handler.SetFloat(Task.getState, key, value));
|
||||
if (handlers.Count == 0)
|
||||
{
|
||||
Debug.LogWarning($"BTC.SetFloat: no components under the name '{objectName}'");
|
||||
Task.SetSucceeded();
|
||||
}
|
||||
}
|
||||
|
||||
[Task]
|
||||
public void Enable(string objectName)
|
||||
{
|
||||
|
|
|
@ -180,6 +180,15 @@ public class ComponentHandler : MonoBehaviour {
|
|||
Task.SetError();
|
||||
}
|
||||
|
||||
public virtual void SetFloat(MyBT.NodeState nodeState, string key, float value)
|
||||
{
|
||||
if (Task.isDebugging)
|
||||
{
|
||||
Debug.LogWarning($"ComponentHandler.SetFloat: not implemented for {this.GetType()}");
|
||||
}
|
||||
Task.SetError();
|
||||
}
|
||||
|
||||
public virtual void Enable(MyBT.NodeState nodeState)
|
||||
{
|
||||
if (Task.isDebugging)
|
||||
|
|
|
@ -114,6 +114,16 @@ public class NamedStudioEventEmitter : ComponentHandler {
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetFloat(NodeState nodeState, string key, float value)
|
||||
{
|
||||
if (nodeState == NodeState.FirstRun)
|
||||
{
|
||||
studioEventEmitter.SetParameter(key, value);
|
||||
Task.SetSucceeded();
|
||||
return;
|
||||
}
|
||||
}
|
||||
#else
|
||||
[Header("FMod Support disabled: Window->MyBT->PreCompiler Definitions")]
|
||||
public string dummy;
|
||||
|
|
Loading…
Reference in New Issue