public void Init(SceneInfo sInfo) { sceneInfo = sInfo; name = sceneInfo.SceneName; terrainThing = new SceneThing(); terrainThing.TerrainContainer = terrainContainer; terrainThing.Init(sceneInfo.TerrainInfo); terrainThing.Show(); }
private void SyncShowThing(List <GameObjectInfo> list, Vector3 position, List <SceneThing> things, float range) { GameObjectInfo gameObjectInfo; SceneThing sceneThing = null; int i = 0; for (i = 0; i < list.Count; ++i) { gameObjectInfo = list[i]; tempVector3.Set(gameObjectInfo.X, gameObjectInfo.Y, gameObjectInfo.Z); float tdistance = Vector3.Distance(position, tempVector3); if (things.Count > i) { sceneThing = things[i]; } if (tdistance <= range) { if (sceneThing == null) { sceneThing = new SceneThing(); sceneThing.BlocksContainer = blocksContainer; sceneThing.NonblocksContainer = nonblocksContainer; sceneThing.EffectContainer = effectsContainer; sceneThing.LightsContainer = lightsContainer; things.Add(sceneThing); } sceneThing.Init(gameObjectInfo); sceneThing.Show(); } else if (sceneThing != null) { sceneThing.Hide(); } sceneThing = null; } }