Fix Shose blinking immediately at start by adding OnDisable hook and correctly disabling the script before activating the object
This commit is contained in:
@@ -14,6 +14,12 @@ public class ShoseClickHandler : MonoBehaviour
|
|||||||
private Quaternion _initialRotation;
|
private Quaternion _initialRotation;
|
||||||
private bool _hasRecordedInitialTransform = false;
|
private bool _hasRecordedInitialTransform = false;
|
||||||
|
|
||||||
|
void OnDisable()
|
||||||
|
{
|
||||||
|
StopAllCoroutines();
|
||||||
|
if (_outlineMesh != null) _outlineMesh.enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
void OnEnable()
|
void OnEnable()
|
||||||
{
|
{
|
||||||
var mf = GetComponent<MeshFilter>();
|
var mf = GetComponent<MeshFilter>();
|
||||||
|
|||||||
@@ -455,8 +455,8 @@ public class PageController : MonoBehaviour
|
|||||||
h.nextObject = chanraotuibu;
|
h.nextObject = chanraotuibu;
|
||||||
}
|
}
|
||||||
// 确保一开始鞋子模型可见,但不闪烁且不可点击
|
// 确保一开始鞋子模型可见,但不闪烁且不可点击
|
||||||
shose.SetActive(true);
|
|
||||||
h.enabled = false;
|
h.enabled = false;
|
||||||
|
shose.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (point2 != null)
|
if (point2 != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user