internal void Initialize(UGrassData data, bool newObj) { if (m_Terrain == null || newObj) { m_Terrain = data.terrain; } if (m_GameObject == null || newObj) { m_GameObject = new GameObject(texture.name); m_GameObject.transform.parent = data.gameObject.transform; m_GameObject.transform.localPosition = Vector3.zero; m_GameObject.transform.localEulerAngles = Vector3.zero; m_GameObject.transform.localScale = Vector3.one; m_GameObject.hideFlags = HideFlags.DontSave; } m_Material = null; m_Groups.ForEach(g => g.Initialize(m_GameObject.transform, m_Terrain, material, newObj)); m_ApplyGroup = new List <int>(); active = m_Active; }
public UGrass(Texture2D texture, UGrassData data) { m_Texture = texture; Initialize(data); }
public void Initialize(UGrassData data) { Initialize(data, false); }