void Init() { if (!inited) { if (Dfm != null) { Dfm.Initialize(sysr.ResourceManager); } if (Model != null && Model.Levels.Length > 0) { Model.Initialize(sysr.ResourceManager); } else if (Cmp != null) { Cmp.Initialize(sysr.ResourceManager); } else if (Sph != null) { Sph.Initialize(sysr.ResourceManager); if (Sph.SideMaterials.Length > 6) { radiusAtmosphere = Sph.Radius * Math.Max(Sph.SideMaterials[6].Scale, 1f); } else { radiusAtmosphere = Sph.Radius; } } inited = true; } }
public override void Register(SystemRenderer renderer) { sysr = renderer; sysr.Objects.Add(this); if (!inited) { if (Dfm != null) { Dfm.Initialize(sysr.Game.ResourceManager); } if (Model != null && Model.Levels.Length > 0) { Model.Initialize(sysr.Game.ResourceManager); } else if (Cmp != null) { Cmp.Initialize(sysr.Game.ResourceManager); } else if (Sph != null) { Sph.Initialize(sysr.Game.ResourceManager); if (Sph.SideMaterials.Length > 6) { radiusAtmosphere = Sph.Radius * Sph.SideMaterials[6].Scale; } else { radiusAtmosphere = Sph.Radius; } } inited = true; } }