void Awake() { Instance = this; ActorPos = transform; // 查找主光源 Vector3 light_dir = new Vector3(0, -1, -1); var shadow_light_info = GetComponent <ShadowLightInfo>(); if (shadow_light_info != null) { light_dir = shadow_light_info.LightDir; } ShadowManager.Instance.SetRealShadow(ActorPos, light_dir, 1 << LayerMask.NameToLayer("UIPreview")); }
private void OnDestroy() { Instance = null; }