From 4e46f701027da081d60aa96e0814996c7acfa70a Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 10 Sep 2021 20:18:36 +0800 Subject: *misc --- Assets/Scripts/Unit/Controller/UnitController.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Assets/Scripts/Unit/Controller/UnitController.cs') 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().bounds.center; } + set + { + Vector3 offset = new Vector3(0, -GetComponentInChildren().bounds.size.y / 2f, 0); + transform.position = value + offset; + } } public virtual void Initialize( GameObject obj , string folder) -- cgit v1.1-26-g67d0