From cec37ddb003304a224b804a78479ae46dae58fed Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 16 Sep 2021 20:51:19 +0800 Subject: + motion blur --- Assets/Scripts/Unit/Components/UnitRender.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Assets/Scripts/Unit/Components/UnitRender.cs') diff --git a/Assets/Scripts/Unit/Components/UnitRender.cs b/Assets/Scripts/Unit/Components/UnitRender.cs index b3fd18c8..435c517d 100644 --- a/Assets/Scripts/Unit/Components/UnitRender.cs +++ b/Assets/Scripts/Unit/Components/UnitRender.cs @@ -7,6 +7,23 @@ using UnityEngine; public class UnitRender : UnitComponent { + public override void Initialize() + { + base.Initialize(); + } + public void SetVisibilityInMainCamera(bool isVisible) + { + LayerMask mask = LayerMask.GetMask("PlayerCharacter"); + + if(!isVisible) + { + SceneManager.Instance.mainCamera.cullingMask &= ~mask.value; + } + else + { + SceneManager.Instance.mainCamera.cullingMask |= mask.value; + } + } } -- cgit v1.1-26-g67d0