summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Unit/Controller/UnitController.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-10 20:18:36 +0800
committerchai <chaifix@163.com>2021-09-10 20:18:36 +0800
commit4e46f701027da081d60aa96e0814996c7acfa70a (patch)
treecd4ec98af78dd957e5abb93497db415a708fd93e /Assets/Scripts/Unit/Controller/UnitController.cs
parent259d0669aecc184af3c99f3cf9d279f07ae0168f (diff)
*misc
Diffstat (limited to 'Assets/Scripts/Unit/Controller/UnitController.cs')
-rw-r--r--Assets/Scripts/Unit/Controller/UnitController.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Assets/Scripts/Unit/Controller/UnitController.cs b/Assets/Scripts/Unit/Controller/UnitController.cs
index 2f43b4e4..bbcdc745 100644
--- a/Assets/Scripts/Unit/Controller/UnitController.cs
+++ b/Assets/Scripts/Unit/Controller/UnitController.cs
@@ -94,6 +94,11 @@ public class UnitController : MonoBehaviour/*, Interactable*/
{
return GetComponentInChildren<Renderer>().bounds.center;
}
+ set
+ {
+ Vector3 offset = new Vector3(0, -GetComponentInChildren<Renderer>().bounds.size.y / 2f, 0);
+ transform.position = value + offset;
+ }
}
public virtual void Initialize( GameObject obj , string folder)