using System.Collections; using System.Collections.Generic; using UnityEngine; /* 在静止靶时, 在左边小靶上保留上次射箭时的箭的位置(高亮点表示) 下次再射箭时候取消前次高亮点, 以便用户更好的针对上次射箭的状态进行调整 */ public class PointSignLastHit : MonoBehaviour { public static PointSignLastHit ins; void Start() { ins = this; //不是GameDouble按照以前的Test处理 //if (UnityEngine.SceneManagement.SceneManager.GetActiveScene().name != "GameDouble") { gameObject.layer = LayerMask.NameToLayer("Test"); } Hide(); GameEventCenter.ins.onBowArrowShootOut += (a, b) => { Hide(); }; } void OnDestroy() { if (ins == this) ins = null; } public void Hide() { gameObject.SetActive(false); } public void Show(Vector3 pos) { transform.position = pos; gameObject.SetActive(true); } }