ProjectDDD/Packages/SLUnity/SLUI/SLWorldTransform.cs

36 lines
751 B
C#
Raw Normal View History

using System.Collections;
using System.Collections.Generic;
using Superlazy;
using Superlazy.UI;
using UnityEngine;
public class SLWorldTransform : SLUIComponent
{
public string bind = "TargetPosition";
protected override void Validate()
{
}
protected override void Init()
{
}
private void Update()
{
if (bindParent.Active == false) return;
var posEntity = SLEntity.Empty;
posEntity["X"] = transform.position.x;
posEntity["Y"] = transform.position.y;
posEntity["Z"] = transform.position.z;
SLGame.Session.Get(bindParent.BindPath).Set(bind, posEntity);
}
protected override void Enable()
{
}
protected override void Disable()
{
}
}