void Awake() { if (instance != null) { Debug.LogWarning("More than one instance of extraPoints found!"); return; } instance = this; }
public void SpawnExtrapoints(int v) { extraPoints e = Instantiate(ex) as extraPoints; e.transform.SetParent(this.transform); GameObject t = e.transform.GetChild(0).GetChild(0).gameObject; Text _text = t.GetComponent <Text>(); _text.text += v.ToString(); /* * Debug.Log("El text: " + e.getText()); * e.setText(v); */ }