From 15ac78b26af4c9e54e2d30c7f1781dddf64fc6f2 Mon Sep 17 00:00:00 2001 From: Mark Joshwel Date: Sat, 10 Aug 2024 02:28:59 +0800 Subject: [PATCH] game: simplify if expr for OpenDoor() --- RunningLateGame/Assets/Scripts/Door.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/RunningLateGame/Assets/Scripts/Door.cs b/RunningLateGame/Assets/Scripts/Door.cs index ec00399..d257dfa 100644 --- a/RunningLateGame/Assets/Scripts/Door.cs +++ b/RunningLateGame/Assets/Scripts/Door.cs @@ -96,10 +96,7 @@ private IEnumerator OpenDoor() { currentDuration = 0; _opening = false; - if (_isOpen) - _isOpen = false; - else - _isOpen = true; + _isOpen = !_isOpen; } yield return new WaitForEndOfFrame();