Fix Shose blinking immediately at start by adding OnDisable hook and correctly disabling the script before activating the object

This commit is contained in:
yangbear
2026-07-11 05:21:23 +08:00
parent d32a524308
commit 688b4b29fc
2 changed files with 7 additions and 1 deletions
@@ -14,6 +14,12 @@ public class ShoseClickHandler : MonoBehaviour
private Quaternion _initialRotation;
private bool _hasRecordedInitialTransform = false;
void OnDisable()
{
StopAllCoroutines();
if (_outlineMesh != null) _outlineMesh.enabled = false;
}
void OnEnable()
{
var mf = GetComponent<MeshFilter>();