2019年8月21日 星期三

[C#, unity] Fixed: The name instantiate' does not exist in the current context

                        Transform cloneTransform = m_fields.GetChild(nColumn).GetChild(nIndex);
                        Transform tempTransform = Instantiate(cloneTransform).transform;
                        tempTransform.SetParent(m_fields.GetChild(nColumn));
                        tempTransform.localPosition = Vector3.zero;
                        tempTransform.localRotation = Quaternion.identity;
                        tempTransform.localScale = Vector3.one;


Answer:

Transform tempTransform = GameObject.Instantiate(cloneTransform).transform;

沒有留言:

張貼留言