// *********************************************************************** // Assembly : Unity // Author : Kimch // Created : 2017-11-14 // // Last Modified By : Kimch // Last Modified On : // *********************************************************************** // // // *********************************************************************** using UnityEngine; namespace G { /// /// 影子 /// public class Shadow : MonoBehaviour { private Transform _parent; public void PickParent(Transform parent, float shadowScale) { _parent = parent; this.transform.localScale = Vector3.one * shadowScale; } public void Finish() { _parent = null; this.transform.position = Vector3.one * 3f; this.gameObject.SetActive(false); } private void LateUpdate() { if (_parent) { var shadowPos = _parent.position; shadowPos.y = 0f; this.transform.position = shadowPos; } else { Finish(); } } } }