コード例 #1
0
	public void SetupProfile() {
		if (LightingManager2D.initialized) {
			return;
		}

		LightingManager2D.initialized = true;

		LightingSettings.Profile profile = Lighting2D.Profile;
		Lighting2D.UpdateByProfile(profile);

		AtlasSystem.Manager.Initialize();
		Lighting2D.materials.Reset();
	}
コード例 #2
0
	private void Update() {
		if (Lighting2D.disable) {
			return;
		}

		ForceUpdate(); // For Late Update Method?

		//if (Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.LeftShift) && Input.GetKeyDown(KeyCode.L)) {
		//	debug = !debug;
		//}

		if (profile != null) {
			if (Lighting2D.Profile != profile) {
				Lighting2D.UpdateByProfile(profile);
			}
        }
	}
コード例 #3
0
ファイル: Game1.cs プロジェクト: Mattlekim/RiddlersoftLib
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            bg = Content.Load <Texture2D>("foreset2");
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            pEffect  = BuildRobotSmokeEffect(Content); //this loades in an effect
            pEffect2 = BuildGreenSmoke(Content);       //this loads in a second effect

            lighteffect = Lighting2D.Load(Content);

            _tex = Content.Load <Texture2D>("osr screen");
            _tex.SetState(Riddlersoft.Graphics.Texture2DSwip.TextureState.Compile);
            //lighteffect.Parameters["Brightness"].SetValue(0f);
            IsMouseVisible = true;

            eEffect = new EletricityEffect(this);
        }
コード例 #4
0
    static public void Draw()
    {
        EditorGUI.BeginChangeCheck();

        LightingSettings.ProjectSettings mainProfile = Lighting2D.ProjectSettings;

        mainProfile.Profile = (LightingSettings.Profile)EditorGUILayout.ObjectField("Default Profile", mainProfile.Profile, typeof(LightingSettings.Profile), true);

        EditorGUILayout.Space();

        mainProfile.renderingMode = (RenderingMode)EditorGUILayout.EnumPopup("Rendering Mode", mainProfile.renderingMode);

        EditorGUILayout.Space();

        mainProfile.colorSpace = (LightingSettings.ColorSpace)EditorGUILayout.EnumPopup("Color Space", mainProfile.colorSpace);

        EditorGUILayout.Space();

        mainProfile.managerInstance = (LightingSettings.ManagerInstance)EditorGUILayout.EnumPopup("Manager Instance", mainProfile.managerInstance);

        mainProfile.managerInternal = (LightingSettings.ManagerInternal)EditorGUILayout.EnumPopup("Manager Internal", mainProfile.managerInternal);

        EditorGUILayout.Space();

        mainProfile.MaxLightSize = EditorGUILayout.IntSlider("Max Light Size", mainProfile.MaxLightSize, 10, 1000);

        EditorGUILayout.Space();

        EditorView.Draw(mainProfile);

        EditorGUILayout.Space();

        Chunks.Draw(mainProfile);

        EditorGUI.EndChangeCheck();

        if (GUI.changed)
        {
            LightingManager2D.ForceUpdate();
            Lighting2D.UpdateByProfile(mainProfile.Profile);

            EditorUtility.SetDirty(mainProfile);
        }
    }
コード例 #5
0
	private void OnDisable() {
		if (profile != null) {
			if (Application.isPlaying) {
				if (setProfile != profile) {
					if (Lighting2D.Profile == profile) {
						Lighting2D.RemoveProfile();
					}
				}
			}
		}

		#if UNITY_EDITOR
			#if UNITY_2019_1_OR_NEWER
				SceneView.beforeSceneGui -= OnSceneView;
				//SceneView.duringSceneGui -= OnSceneView;
			#else
				SceneView.onSceneGUIDelegate -= OnSceneView;
			#endif
		#endif
	}
コード例 #6
0
ファイル: Q19Game.cs プロジェクト: SvDvorak/Q19
        public Q19Game()
        {
            StartTime                = DateTime.Now;
            Instance                 = this;
            Graphics                 = new GraphicsDeviceManager(this);
            Content.RootDirectory    = "Data";
            Window.AllowUserResizing = true;
            IsMouseVisible           = DebugMode;
            Lighting                 = new Lighting2D(GD, GameWidth, GameHeight)
            {
                EnableDebugLight = false
            };
            Camera2D     = Matrix.CreateTranslation(new Vector3(GameWidth / 2, GameHeight / 2, 0));
            Window.Title = "Q19";

            Graphics.PreferredBackBufferWidth  = GameWidth;
            Graphics.PreferredBackBufferHeight = GameHeight;
            Graphics.ApplyChanges();

            _cameraPosition = Vector3.Down * 0.5f + Vector3.Forward * 2;

            //Scene = new Scene();
            //Highscore = new Highscore("Q19", 1);
        }