private void OnDestroy() { if (Instance == this) { Instance = null; } }
// Start is called before the first frame update void Start() { if (Instance != null) { Destroy(gameObject); } else { Instance = this; } MoveIndicator = Instantiate(MoveIndicator); MoveIndicator.transform.position += new Vector3(0, 0, -4); MoveIndicator.SetActive(false); Move = MoveIndicator.GetComponent <Transform>(); for (int i = 0; i < 6; i++) { ArrowScale[i] = ((ZDGameRule.UNIT_IN_WORLD / 3) * i); } MoveIndicator.transform.localScale = new Vector3(ZDGameRule.UNIT_IN_WORLD, ZDGameRule.UNIT_IN_WORLD, 1); }