public static LevelGameObject Deserialize(LevelDescription parentLevel, XElement element) { string typeName = element.Attribute(TYPE_ATTRIBUTE_NAME).Value; int id = Int32.Parse(element.Attribute(ID_ATTRIBUTE_NAME).Value); Type goType = typeNames.Single(kvp => kvp.Value == typeName).Key; LevelGameObject result = (LevelGameObject)Activator.CreateInstance(goType, parentLevel, id); lock (result.instanceMutationLock) { string groundingEntityAttrValue = element.Attribute(GROUNDING_ENTITY_ID_ATTRIBUTE_NAME).Value; result.groundingEntityID = groundingEntityAttrValue == String.Empty ? (int?)null : Int32.Parse(groundingEntityAttrValue); result.transform = Transform.Parse(element.Attribute(TRANSFORM_ATTRIBUTE_NAME).Value); result.useSimpleGrounding = Boolean.Parse(element.Attribute(USE_SIMPLE_GROUNDING_ATTRIBUTE_NAME).Value); result.PerformCustomDeserialization(element); } return(result); }
private static void LoadMenuBackdrop(SkyLevelDescription preloadedSky) { UnloadMenuBackdrop(); if (!inDeferenceMode) { cameraLight = new Light(Vector3.ZERO, CAMERA_LIGHT_RADIUS, Vector3.ONE * CAMERA_LIGHT_INTENSITY); AssetLocator.LightPass.AddLight(cameraLight); //AssetLoader.ClearCache(); // TODO work out whether we really need this line? if (!Single.IsPositiveInfinity(Config.DofLensMaxBlurDist)) { AssetLocator.LightPass.SetLensProperties(DOF_FOCAL_DIST, DOF_MAX_DIST); } AssetLocator.MainCamera.Position = Vector3.ZERO + Vector3.DOWN * BACKDROP_CAM_VERTICAL_OFFSET; AssetLocator.ShadowcasterCamera.Position = Vector3.UP * SILLY_BIT_DROP_HEIGHT * 1.1f; AssetLocator.ShadowcasterCamera.LookAt(Vector3.DOWN, Vector3.FORWARD); AssetLocator.ShadowcasterCamera.OrthographicDimensions = new Vector3(100f, 100f, PhysicsManager.ONE_METRE_SCALED * 3f); Quaternion downTilt = Quaternion.FromAxialRotation(Vector3.LEFT, BACKDROP_CAM_UPWARD_TILT); AssetLocator.MainCamera.Orient(Vector3.FORWARD * downTilt, Vector3.UP * downTilt); BGMManager.CrossFadeToTitleMusic(); mainMenuSinceLoad = false; } if (preloadedSky != null) { loadedMenuBackdrop = preloadedSky; } else { int worldIndex = RandomProvider.Next(0, PersistedWorldData.GetFurthestUnlockedWorldIndex() + 1); loadedMenuBackdrop = (SkyLevelDescription)LevelDescription.Load( Path.Combine(AssetLocator.LevelsDir, LevelDatabase.SkyboxFileNames[worldIndex]) ); loadedMenuBackdrop.ReinitializeAll(); worldIconTex.Texture = AssetLocator.WorldIcons[worldIndex]; } }
private DynamicLight(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id) { }
public DynamicLight(LevelDescription parentLevel, int id) : base(parentLevel, id) { }
private IntroCameraAttracter(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id) { }
public IntroCameraAttracter(LevelDescription parentLevel, int id) : base(parentLevel, id) { }
protected LevelGameObject(LevelDescription parentLevel, int id) { this.ParentLevel = parentLevel; ID = id; }
public StartFlag(LevelDescription parentLevel, int id) : base(parentLevel, id) { }
private Shadowcaster(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id) { }
public Shadowcaster(LevelDescription parentLevel, int id) : base(parentLevel, id) { }
public LizardCoin(LevelDescription parentLevel, int id) : base(parentLevel, id) { }
public VultureEgg(LevelDescription parentLevel, int id) : base(parentLevel, id) { }
private FinishingBell(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id) { }
public FinishingBell(LevelDescription parentLevel, int id) : base(parentLevel, id) { }