public void setDayLight(DayLight val) { Lighting = val; switch (Lighting) { case DayLight.Day: RenderSettings.ambientLight = FengColor.AmbientDay; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.Day; base.gameObject.GetComponent <Skybox>().material = skyBoxDAY; break; case DayLight.Dawn: RenderSettings.ambientLight = FengColor.AmbientDawn; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.AmbientDawn; base.gameObject.GetComponent <Skybox>().material = skyBoxDAWN; break; case DayLight.Night: /* TODO: Flashlight is now handled in HERO#Start() * GameObject gameObject = (GameObject)Object.Instantiate(Resources.Load("flashlight")); * gameObject.transform.parent = base.transform; * gameObject.transform.position = base.transform.position; * gameObject.transform.rotation = Quaternion.Euler(353f, 0f, 0f);*/ RenderSettings.ambientLight = FengColor.AmbientNight; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.Night; base.gameObject.GetComponent <Skybox>().material = skyBoxNIGHT; break; } snapShotCamera.gameObject.GetComponent <Skybox>().material = base.gameObject.GetComponent <Skybox>().material; }
public void setDayLight(DayLight val) { dayLight = val; bool custom = Settings.CustomAmbientSetting; switch (dayLight) { case DayLight.Night: var obj2 = (GameObject)Instantiate(Resources.Load("flashlight")); obj2.transform.parent = transform; obj2.transform.position = transform.position; obj2.transform.rotation = Quaternion.Euler(353f, 0f, 0f); RenderSettings.ambientLight = custom ? new Color(Settings.CustomAmbientColorSetting[2][0], Settings.CustomAmbientColorSetting[2][1], Settings.CustomAmbientColorSetting[2][2]) : FengColor.nightAmbientLight; GameObjectCache.Find("mainLight").GetComponent <Light>().color = FengColor.nightLight; gameObject.GetComponent <Skybox>().material = skyBoxNIGHT; break; case DayLight.Day: RenderSettings.ambientLight = custom ? new Color(Settings.CustomAmbientColorSetting[0][0], Settings.CustomAmbientColorSetting[0][1], Settings.CustomAmbientColorSetting[0][2]) : FengColor.dayLight; GameObjectCache.Find("mainLight").GetComponent <Light>().color = FengColor.dayLight; gameObject.GetComponent <Skybox>().material = skyBoxDAY; break; case DayLight.Dawn: RenderSettings.ambientLight = custom ? new Color(Settings.CustomAmbientColorSetting[1][0], Settings.CustomAmbientColorSetting[1][1], Settings.CustomAmbientColorSetting[1][2]) : FengColor.dawnAmbientLight; GameObjectCache.Find("mainLight").GetComponent <Light>().color = FengColor.dawnAmbientLight; gameObject.GetComponent <Skybox>().material = skyBoxDAWN; break; } snapShotCamera.gameObject.GetComponent <Skybox>().material = gameObject.GetComponent <Skybox>().material; }
public void setDayLight(DayLight val) { dayLight = val; if (dayLight == DayLight.Night) { GameObject obj2 = (GameObject)UnityEngine.Object.Instantiate(Resources.Load("flashlight")); obj2.transform.parent = base.transform; obj2.transform.position = base.transform.position; obj2.transform.rotation = Quaternion.Euler(353f, 0f, 0f); RenderSettings.ambientLight = FengColor.nightAmbientLight; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.nightLight; base.gameObject.GetComponent <Skybox>().material = this.skyBoxNIGHT; } if (dayLight == DayLight.Day) { RenderSettings.ambientLight = FengColor.dayAmbientLight; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.dayLight; base.gameObject.GetComponent <Skybox>().material = this.skyBoxDAY; } if (dayLight == DayLight.Dawn) { RenderSettings.ambientLight = FengColor.dawnAmbientLight; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.dawnAmbientLight; base.gameObject.GetComponent <Skybox>().material = this.skyBoxDAWN; } this.snapShotCamera.gameObject.GetComponent <Skybox>().material = base.gameObject.GetComponent <Skybox>().material; }
private void Awake() { startingPlayerPosition = FindObjectOfType <PlayerMovement>().transform.position; timeOfDay = FindObjectOfType <TimeOfDay>(); dayLight = FindObjectOfType <DayLight>(); gameSession = FindObjectOfType <GameSession>(); }
public void SetLighting(DayLight val) { Lighting = val; switch (Lighting) { case DayLight.Day: RenderSettings.ambientLight = FengColor.AmbientDay; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.Day; base.gameObject.GetComponent <Skybox>().material = skyBoxDAY; break; case DayLight.Dawn: RenderSettings.ambientLight = FengColor.AmbientDawn; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.AmbientDawn; base.gameObject.GetComponent <Skybox>().material = skyBoxDAWN; break; case DayLight.Night: RenderSettings.ambientLight = FengColor.AmbientNight; GameObject.Find("mainLight").GetComponent <Light>().color = FengColor.Night; base.gameObject.GetComponent <Skybox>().material = skyBoxNIGHT; break; } if (FengGameManagerMKII.SkyMaterial != null && FengGameManagerMKII.SkyMaterial != base.gameObject.GetComponent <Skybox>().material) { base.gameObject.GetComponent <Skybox>().material = FengGameManagerMKII.SkyMaterial; } snapShotCamera.gameObject.GetComponent <Skybox>().material = base.gameObject.GetComponent <Skybox>().material; }
private void Awake() { timeOfDay = FindObjectOfType <TimeOfDay>(); dayLight = FindObjectOfType <DayLight>(); gameSession = FindObjectOfType <GameSession>(); endOfDayTally = FindObjectOfType <EndOfDayTally>(); enemySpawns = FindObjectOfType <EnemySpawns>(); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { DrawOrder = new List <Sprite>(); Collidable = new List <Sprite>(); UpdateOrder = new HashSet <Sprite>(); this.camera = new Camera(GraphicsDevice); collision = new SpatialBounding(new Rectangle(0, 0, GameOptions.PrefferedBackBufferWidth, GameOptions.PrefferedBackBufferHeight), this.camera); map = new TileGameMap(this.camera); dayLight = new DayLight(Content, GraphicsDevice); weather = new Weather(Content, GraphicsDevice); lightsTarget = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); ambientLight = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); worldScene = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); interiorScene = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height); base.Initialize(); }
public static string GetDayLight() { var dayLight = "Day"; switch (IN_GAME_MAIN_CAMERA.dayLight) { case DayLight.Day: return(dayLight = "Day"); case DayLight.Dawn: return(dayLight = "Dawn"); case DayLight.Night: return(dayLight = "Night"); } return(dayLight); }