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);
        }
Beispiel #2
0
        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];
            }
        }
Beispiel #3
0
 private DynamicLight(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id)
 {
 }
Beispiel #4
0
 public DynamicLight(LevelDescription parentLevel, int id)
     : base(parentLevel, id)
 {
 }
Beispiel #5
0
 private IntroCameraAttracter(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id)
 {
 }
Beispiel #6
0
 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)
 {
 }
Beispiel #12
0
 public VultureEgg(LevelDescription parentLevel, int id) : base(parentLevel, id)
 {
 }
Beispiel #13
0
 private FinishingBell(LevelDescription parentLevel, LevelGeometryEntity groundingGeometryEntity, Transform transform, bool useSimpleGrounding, int id) : base(parentLevel, groundingGeometryEntity, transform, useSimpleGrounding, id)
 {
 }
Beispiel #14
0
 public FinishingBell(LevelDescription parentLevel, int id) : base(parentLevel, id)
 {
 }