protected void Awake() { if (instance == null) { instance = this; } }
// Use this for initialization void Start() { if (centerQTE == null) { centerQTE = GameObject.FindGameObjectWithTag("KeepPlayer").GetComponentInChildren <QTE>(); } Button btn = this.GetComponent <Button>(); btn.onClick.AddListener(OnClick); }
private void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); } else { instance = this; } }
public void DirectionChoosed(HexDirection dir) { cellChooser.SetActive(false); HexCell cell = unit.Location.GetNeighbor(dir); if (cell != null && cell.Unit != null) { Vector3 direction = cell.Unit.transform.position - unit.transform.position; float angle = Vector3.SignedAngle(Vector3.forward, direction, Vector3.up); qte = Instantiate(qtePrefab, unit.transform.position + Vector3.up, Quaternion.AngleAxis(angle, Vector3.up), null); StartCoroutine(QTESequences(cell.Unit)); } }
void Start() { text.SetActive(false); button.SetActive(false); qteScript = GameObject.Find("QTE").GetComponent <QTE>(); }