Inheritance: MonoBehaviour
Esempio n. 1
0
 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);
    }
Esempio n. 3
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
     }
 }
Esempio n. 4
0
    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));
        }
    }
Esempio n. 5
0
 void Start()
 {
     text.SetActive(false);
     button.SetActive(false);
     qteScript = GameObject.Find("QTE").GetComponent <QTE>();
 }