Source Rotation#
Args / Source Rotation
Can Read
Can Write
Description#
The Transform euler rotation angles of the Source object
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get, Set]
[Title("Source Rotation")]
[Category("Args/Source Rotation")]
[Description("The Transform euler rotation angles of the Source object")]
[Image(typeof(IconSource), ColorTheme.Type.Yellow)]
[Keywords("Self")]
[Serializable]
public class TypeVector3SourceEuler : TypeVector3
{
public override Vector3 GetPreview(GameObject source)
{
return source != null ? source.transform.eulerAngles : default;
}
public override Vector3 Get(Args args)
{
return args.Source != null ? args.Source.transform.eulerAngles : Vector3.zero;
}
public override void Set(Vector3 value, Args args)
{
if (args.Source == null) return;
args.Source.transform.eulerAngles = value;
}
public override string ToString() => "Source Rotation";
protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
}
}