Skip to content

Commit

Permalink
Version 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Real-Gecko committed Oct 16, 2016
1 parent 4f7ba2f commit 3c6b9d7
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 192 deletions.
95 changes: 40 additions & 55 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,55 +1,40 @@
# Created by https://www.gitignore.io

### XamarinStudio ###
bin/
obj/
*.userprefs


### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk
#Autosave files
*~

#build
[Oo]bj/
[Bb]in/
packages/
TestResults/

# globs
Makefile.in
*.DS_Store
*.sln.cache
*.suo
*.cache
*.pidb
*.userprefs
*.usertasks
config.log
config.make
config.status
aclocal.m4
install-sh
autom4te.cache/
*.user
*.tar.gz
tarballs/
test-results/
Thumbs.db

#Mac bundle stuff
*.dmg
*.app

#resharper
*_Resharper.*
*.Resharper

#dotCover
*.dotCover
Binary file modified GameData/LightsOut/LightsOut.dll
Binary file not shown.
17 changes: 17 additions & 0 deletions LightsOut.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightsOut", "LightsOut\LightsOut.csproj", "{DB34E9C6-59E1-4313-B8BF-CE6039EEAAE9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DB34E9C6-59E1-4313-B8BF-CE6039EEAAE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB34E9C6-59E1-4313-B8BF-CE6039EEAAE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB34E9C6-59E1-4313-B8BF-CE6039EEAAE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB34E9C6-59E1-4313-B8BF-CE6039EEAAE9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
30 changes: 15 additions & 15 deletions Source/LightsOut/LOAmbient.cs → LightsOut/LOAmbient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine;

namespace LightsOut {
Expand All @@ -15,7 +15,7 @@ class LOAmbient {
// Original Configurations
int originalCullingMask;
CameraClearFlags originalClearFlags;
Color originalAmbientLight;
Color originalAmbientLight;
UnityEngine.Rendering.AmbientMode originalAmbientMode;
LightmapData[] originalLightmapData;
Material originalSkybox;
Expand All @@ -29,40 +29,40 @@ public LOAmbient(EditorFacility facility, EditorLevel level, GameObject[] gameOb
originalClearFlags = camera.clearFlags;
originalAmbientLight = RenderSettings.ambientLight;
originalSkybox = RenderSettings.skybox;
originalLightmapData = LightmapSettings.lightmaps;
originalLightmapData = LightmapSettings.lightmaps;
originalAmbientMode = RenderSettings.ambientMode;

// Create fake skybox
skyCamera = new GameObject("NightSkyboxCamera", typeof(Camera));
skyCamera = new GameObject("NightSkyboxCamera", typeof(Camera));
// skyCamera.AddComponent<Camera>();
skyCamera.GetComponent<Camera>().depth = mainCamera.depth - 1;
skyCamera.GetComponent<Camera>().clearFlags = CameraClearFlags.Skybox;
skyCamera.GetComponent<Camera>().depth = mainCamera.depth - 1;
skyCamera.GetComponent<Camera>().clearFlags = CameraClearFlags.Skybox;
skyCamera.GetComponent<Camera>().cullingMask = 0;

nightSkyboxMaterial = new Material(originalSkybox);

// GalaxyTex_PositiveX should be viewed outside window
Debug.Log("LightsOut: Loading Night Sky Textures");
// Debug.Log("LightsOut: Loading Night Sky Textures");
foreach (Material material in Resources.FindObjectsOfTypeAll<Material>()) {
Texture texture = material.mainTexture;
if (texture) {
switch (material.name) {
case "ZP (Instance)":
case "ZP":
nightSkyboxMaterial.SetTexture("_FrontTex", material.mainTexture);
break;
case "ZN (Instance)":
case "ZN":
nightSkyboxMaterial.SetTexture("_BackTex", material.mainTexture);
break;
case "XP (Instance)":
case "XP":
nightSkyboxMaterial.SetTexture("_LeftTex", material.mainTexture);
break;
case "XN (Instance)":
case "XN":
nightSkyboxMaterial.SetTexture("_RightTex", material.mainTexture);
break;
case "YP (Instance)":
case "YP":
nightSkyboxMaterial.SetTexture("_UpTex", material.mainTexture);
break;
case "YN (Instance)":
case "YN":
nightSkyboxMaterial.SetTexture("_DownTex", material.mainTexture);
break;
default:
Expand Down Expand Up @@ -116,8 +116,8 @@ public LOAmbient(EditorFacility facility, EditorLevel level, GameObject[] gameOb
}

public void SetAmbientMode(EditorTime time) {
if (time == EditorTime.Night) {
RenderSettings.ambientLight = new Color(0.15f, 0.15f, 0.15f);
if (time == EditorTime.Night) {
RenderSettings.ambientLight = new Color(0.15f, 0.15f, 0.15f);
RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Flat;
RenderSettings.fog = false;
mainCamera.clearFlags = CameraClearFlags.Nothing;
Expand Down
22 changes: 11 additions & 11 deletions Source/LightsOut/LOEnums.cs → LightsOut/LOEnums.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System;

public enum EditorLevel {
Level1 = 1,
Level2 = 2,
Level3 = 3
}

public enum EditorTime {
Day = 1,
Night = 2
using System;

public enum EditorLevel {
Level1 = 1,
Level2 = 2,
Level3 = 3
}

public enum EditorTime {
Day = 1,
Night = 2
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using UnityEngine;

Expand Down Expand Up @@ -34,9 +34,9 @@ public LOExternalLights(EditorFacility facility, EditorLevel level) {
//[LOG 17:53:55.158] Light 5: Spotlight, RGBA(1.000, 1.000, 1.000, 1.000), Default ON
//[LOG 17:53:55.159] Parent: Day Lights
lightsToChange = new List<LightToChange>() {
new LightToChange(){ name = "SpotlightCraft", parentName = "Day Lights" },
new LightToChange(){ name = "SpotlightSun", parentName = "VAB_interior_modern" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "SpotlightCraft", parentName = "Day Lights" },
new LightToChange(){ name = "SpotlightSun", parentName = "VAB_interior_modern" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Shadow Light", parentName = "Day Lights" } };
break;

Expand All @@ -58,9 +58,9 @@ public LOExternalLights(EditorFacility facility, EditorLevel level) {
//[LOG 17:56:18.874] Light 7: Spotlight, RGBA(1.000, 1.000, 1.000, 1.000), Default ON
//[LOG 17:56:18.875] Parent: Day Lights
lightsToChange = new List<LightToChange>() {
new LightToChange(){ name = "SpotlightCraft", parentName = "Day Lights" },
new LightToChange(){ name = "SpotlightSun", parentName = "VAB_interior_modern" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "SpotlightCraft", parentName = "Day Lights" },
new LightToChange(){ name = "SpotlightSun", parentName = "VAB_interior_modern" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Shadow Light", parentName = "Day Lights" }
};
break;
Expand All @@ -87,9 +87,9 @@ public LOExternalLights(EditorFacility facility, EditorLevel level) {
//[LOG 17:58:21.712] Light 9: Spotlight, RGBA(1.000, 1.000, 1.000, 1.000), Default ON
//[LOG 17:58:21.713] Parent: Day Lights
lightsToChange = new List<LightToChange>() {
new LightToChange(){ name = "SpotlightCraft", parentName = "Day Lights" },
new LightToChange(){ name = "SpotlightSun", parentName = "VAB_interior_modern" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "SpotlightCraft", parentName = "Day Lights" },
new LightToChange(){ name = "SpotlightSun", parentName = "VAB_interior_modern" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Shadow Light", parentName = "Day Lights" }
};
break;
Expand All @@ -115,9 +115,9 @@ public LOExternalLights(EditorFacility facility, EditorLevel level) {
//[LOG 17:54:50.077] Light 7: SpotlightWindow, RGBA(0.866, 0.863, 0.903, 1.000), Default OFF
//[LOG 17:54:50.078] Parent: Editors_DayLights
lightsToChange = new List<LightToChange>() {
new LightToChange(){ name = "Realtime_SpotlightCraft", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_ExteriorSun", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightCraft", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_ExteriorSun", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_Shadow Light", parentName = "Lighting_Realtime" }
};
break;
Expand All @@ -140,9 +140,9 @@ public LOExternalLights(EditorFacility facility, EditorLevel level) {
//[LOG 17:57:04.724] Light 7: SpotlightWindow, RGBA(0.866, 0.863, 0.903, 1.000), Default OFF
//[LOG 17:57:04.725] Parent: Editors_DayLights
lightsToChange = new List<LightToChange>() {
new LightToChange(){ name = "Realtime_SpotlightCraft", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_ExteriorSun", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightCraft", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_ExteriorSun", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_Shadow Light", parentName = "Lighting_Realtime" }
};
break;
Expand All @@ -165,9 +165,9 @@ public LOExternalLights(EditorFacility facility, EditorLevel level) {
//[LOG 17:59:41.833] Light 7: SpotlightWindow, RGBA(0.866, 0.863, 0.903, 1.000), Default ON
//[LOG 17:59:41.834] Parent: Editors_DayLights
lightsToChange = new List<LightToChange>() {
new LightToChange(){ name = "Realtime_SpotlightCraft", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_ExteriorSun", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightCraft", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_ExteriorSun", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_SpotlightScenery", parentName = "Lighting_Realtime" },
new LightToChange(){ name = "Realtime_Shadow Light", parentName = "Lighting_Realtime" }
};
break;
Expand Down
File renamed without changes.
Loading

0 comments on commit 3c6b9d7

Please sign in to comment.