This commit is contained in:
CortexCore
2024-11-03 16:42:23 +08:00
commit b125894cc3
5904 changed files with 1070129 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Name("Set Visibility")]
[Category("GameObject")]
[Description("Set the Renderer active state, thus making the object visible or invisible.")]
public class SetObjectVisibility : ActionTask<Renderer>
{
public enum SetVisibleMode
{
Hide = 0,
Show = 1,
Toggle = 2
}
public SetVisibleMode setTo = SetVisibleMode.Toggle;
protected override string info {
get { return string.Format("{0} {1}", setTo, agentInfo); }
}
protected override void OnExecute() {
bool value;
if ( setTo == SetVisibleMode.Toggle ) {
value = !agent.enabled;
} else {
value = (int)setTo == 1;
}
agent.enabled = value;
EndAction();
}
}
}