示例#1
0
 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;
 }
示例#2
0
 public UGrass(Texture2D texture, UGrassData data)
 {
     m_Texture = texture;
     Initialize(data);
 }
示例#3
0
 public void Initialize(UGrassData data)
 {
     Initialize(data, false);
 }