Fix Ping restart collider issue and Shose flash issue
This commit is contained in:
@@ -16,6 +16,8 @@ public class PingClickHandler : MonoBehaviour
|
||||
if (_modelRenderer == null) _modelRenderer = GetComponentInChildren<MeshRenderer>();
|
||||
foreach (var r in GetComponentsInChildren<Renderer>(true)) r.enabled = false;
|
||||
if (GetComponent<Collider>() == null) gameObject.AddComponent<SphereCollider>().radius = 0.5f;
|
||||
var col = GetComponent<Collider>();
|
||||
if (col != null) col.enabled = true;
|
||||
CreateOutlineMesh();
|
||||
_modelShown = false;
|
||||
_isBlinking = true;
|
||||
@@ -163,7 +165,16 @@ public class PingClickHandler : MonoBehaviour
|
||||
StopAllCoroutines();
|
||||
StartCoroutine(BlinkOutline());
|
||||
}
|
||||
public void UndoShow() { HideSelf(); }
|
||||
public void UndoShow()
|
||||
{
|
||||
_modelShown = false;
|
||||
_isBlinking = false;
|
||||
StopAllCoroutines();
|
||||
if (chanraoObject != null) chanraoObject.SetActive(false);
|
||||
foreach (var r in GetComponentsInChildren<Renderer>(true)) r.enabled = false;
|
||||
var col = GetComponent<Collider>(); if (col != null) col.enabled = false;
|
||||
gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void HideSelf()
|
||||
{
|
||||
@@ -183,6 +194,8 @@ public class PingClickHandler : MonoBehaviour
|
||||
public void ResetState()
|
||||
{
|
||||
_modelShown = false;
|
||||
var col = GetComponent<Collider>();
|
||||
if (col != null) col.enabled = true;
|
||||
_isBlinking = true;
|
||||
if (_modelRenderer != null) _modelRenderer.enabled = false;
|
||||
// 隐藏自身模型
|
||||
|
||||
Reference in New Issue
Block a user