IndieGame/client/Assets/ParadoxNotion/NodeCanvas/Tasks/Actions/GameObject/CreatePrimitive.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

30 lines
800 B
C#

using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;
namespace NodeCanvas.Tasks.Actions
{
[Category("GameObject")]
public class CreatePrimitive : ActionTask
{
public BBParameter<string> objectName;
public BBParameter<Vector3> position;
public BBParameter<Vector3> rotation;
public BBParameter<PrimitiveType> type;
[BlackboardOnly]
public BBParameter<GameObject> saveAs;
protected override void OnExecute() {
var newGO = GameObject.CreatePrimitive(type.value);
newGO.name = objectName.value;
newGO.transform.position = position.value;
newGO.transform.eulerAngles = rotation.value;
saveAs.value = newGO;
EndAction();
}
}
}