From 6311df03d5d7b763770e435718c5e799f857f3fa Mon Sep 17 00:00:00 2001
From: client_Wu Xijin <364452445@qq.com>
Date: 星期日, 21 十月 2018 16:14:50 +0800
Subject: [PATCH] 3335 更新lua库
---
Utility/TransformExtension.cs | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Utility/TransformExtension.cs b/Utility/TransformExtension.cs
index dbfe89a..ad6fbd0 100644
--- a/Utility/TransformExtension.cs
+++ b/Utility/TransformExtension.cs
@@ -147,6 +147,23 @@
return false;
}
+ [XLua.LuaCallCSharp]
+ public static void SetPosition(this Transform transform, float x, float y, float z, bool isLocal = false)
+ {
+ if (transform == null)
+ {
+ return;
+ }
+
+ if (isLocal)
+ {
+ transform.localPosition = new Vector3(x, y, z);
+ }
+ else
+ {
+ transform.position = new Vector3(x, y, z);
+ }
+ }
public static Transform GetRoot(this Transform transform)
{
--
Gitblit v1.8.0