// 绘制乐符文字 private void DrawSymbol(string text, float x, float y) { GameObject mySymbol = GameObject.Instantiate(_commonParams.GetPrefabSymbol(), _parentObject.transform.position, _commonParams.GetPrefabSymbol().transform.rotation); mySymbol.transform.SetParent(_parentObject.transform); Text noteText = mySymbol.GetComponent <Text>(); noteText.transform.localPosition = new Vector3(x, y, 0); noteText.text = text; }
// 绘制乐符文字 protected void DrawSymbol(string text, float x, float y) { GameObject symbolObject = GameObject.Instantiate(CommonParams.GetPrefabSymbol(), ParentObject.transform.position, CommonParams.GetPrefabSymbol().transform.rotation); symbolObject.transform.SetParent(ParentObject.transform); Text noteText = symbolObject.GetComponent <Text>(); noteText.transform.localPosition = new Vector3(x, y, 0); noteText.text = text; }