Readd missing import files
This commit is contained in:
@@ -0,0 +1,192 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace EnviroSamples
|
||||
{
|
||||
public class DemoUI : MonoBehaviour {
|
||||
|
||||
|
||||
public UnityEngine.UI.Slider sliderTime;
|
||||
UnityEngine.UI.Slider sliderQuality;
|
||||
public UnityEngine.UI.Text timeText;
|
||||
public UnityEngine.UI.Text weatherText;
|
||||
public UnityEngine.UI.Text temperatureText;
|
||||
public UnityEngine.UI.Dropdown weatherDropdown;
|
||||
//UnityEngine.UI.Dropdown seasonDropdown;
|
||||
|
||||
//bool seasonmode = true;
|
||||
//bool fastdays = false;
|
||||
|
||||
private bool started = false;
|
||||
|
||||
void Start ()
|
||||
{
|
||||
|
||||
if(EnviroSkyMgr.instance == null || !EnviroSkyMgr.instance.IsAvailable())
|
||||
{
|
||||
this.enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
EnviroSkyMgr.instance.OnWeatherChanged += (EnviroWeatherPreset type) =>
|
||||
{
|
||||
UpdateWeatherSlider ();
|
||||
};
|
||||
|
||||
|
||||
/*EnviroSkyMgr.instance.OnSeasonChanged += (EnviroSeasons.Seasons season) =>
|
||||
{
|
||||
UpdateSeasonSlider(season);
|
||||
};*/
|
||||
}
|
||||
|
||||
IEnumerator setupDrodown ()
|
||||
{
|
||||
started = true;
|
||||
yield return new WaitForSeconds (0.1f);
|
||||
|
||||
for (int i = 0; i < EnviroSkyMgr.instance.GetCurrentWeatherPresetList().Count; i++) {
|
||||
UnityEngine.UI.Dropdown.OptionData o = new UnityEngine.UI.Dropdown.OptionData();
|
||||
o.text = EnviroSkyMgr.instance.GetCurrentWeatherPresetList()[i].Name;
|
||||
weatherDropdown.options.Add (o);
|
||||
}
|
||||
|
||||
yield return new WaitForSeconds (0.1f);
|
||||
UpdateWeatherSlider ();
|
||||
}
|
||||
|
||||
public void ChangeTimeSlider ()
|
||||
{
|
||||
if (sliderTime.value < 0f)
|
||||
sliderTime.value = 0f;
|
||||
EnviroSkyMgr.instance.SetTimeOfDay (sliderTime.value * 24f);
|
||||
}
|
||||
|
||||
public void ChangeCloudQuality(int value)
|
||||
{
|
||||
#if ENVIRO_HD
|
||||
EnviroSky.instance.ApplyVolumeCloudsQualityPreset(value);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ChangeAmbientVolume (float value)
|
||||
{
|
||||
EnviroSkyMgr.instance.ambientAudioVolume = value;
|
||||
}
|
||||
|
||||
public void SetTimeOfDay (float value)
|
||||
{
|
||||
EnviroSkyMgr.instance.SetTimeOfDay(value);
|
||||
}
|
||||
|
||||
public void ChangeWeatherVolume (float value)
|
||||
{
|
||||
EnviroSkyMgr.instance.weatherAudioVolume = value;
|
||||
}
|
||||
|
||||
public void SetWeatherID (int id)
|
||||
{
|
||||
EnviroSkyMgr.instance.ChangeWeather (id);
|
||||
}
|
||||
|
||||
public void SetVolumeClouds(bool b)
|
||||
{
|
||||
EnviroSkyMgr.instance.useVolumeClouds = b;
|
||||
}
|
||||
|
||||
public void SetVolumeLighting(bool b)
|
||||
{
|
||||
EnviroSkyMgr.instance.useVolumeLighting = b;
|
||||
}
|
||||
|
||||
public void SetFlatClouds(bool b)
|
||||
{
|
||||
EnviroSkyMgr.instance.useFlatClouds = b;
|
||||
}
|
||||
|
||||
public void SetParticleClouds(bool b)
|
||||
{
|
||||
EnviroSkyMgr.instance.useParticleClouds = b;
|
||||
}
|
||||
|
||||
public void SetSunShafts(bool b)
|
||||
{
|
||||
EnviroSkyMgr.instance.useSunShafts = b;
|
||||
}
|
||||
|
||||
public void SetMoonShafts(bool b)
|
||||
{
|
||||
EnviroSkyMgr.instance.useMoonShafts = b;
|
||||
}
|
||||
|
||||
public void SetSeason (int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
EnviroSkyMgr.instance.ChangeSeason (EnviroSeasons.Seasons.Spring);
|
||||
break;
|
||||
case 1:
|
||||
EnviroSkyMgr.instance.ChangeSeason (EnviroSeasons.Seasons.Summer);
|
||||
break;
|
||||
case 2:
|
||||
EnviroSkyMgr.instance.ChangeSeason (EnviroSeasons.Seasons.Autumn);
|
||||
break;
|
||||
case 3:
|
||||
EnviroSkyMgr.instance.ChangeSeason (EnviroSeasons.Seasons.Winter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SetTimeProgress (int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
EnviroSkyMgr.instance.SetTimeProgress(EnviroTime.TimeProgressMode.None);
|
||||
break;
|
||||
case 1:
|
||||
EnviroSkyMgr.instance.SetTimeProgress(EnviroTime.TimeProgressMode.Simulated);
|
||||
break;
|
||||
case 2:
|
||||
EnviroSkyMgr.instance.SetTimeProgress(EnviroTime.TimeProgressMode.SystemTime);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void UpdateWeatherSlider ()
|
||||
{
|
||||
if (EnviroSkyMgr.instance.GetCurrentWeatherPreset() != null) {
|
||||
for (int i = 0; i < weatherDropdown.options.Count; i++) {
|
||||
if (weatherDropdown.options [i].text == EnviroSkyMgr.instance.GetCurrentWeatherPreset().Name)
|
||||
weatherDropdown.value = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Update ()
|
||||
{
|
||||
if (!EnviroSkyMgr.instance.IsStarted())
|
||||
return;
|
||||
else {
|
||||
if(!started)
|
||||
StartCoroutine(setupDrodown ());
|
||||
}
|
||||
|
||||
timeText.text = EnviroSkyMgr.instance.GetTimeString ();
|
||||
if(EnviroSkyMgr.instance.GetCurrentWeatherPreset() != null)
|
||||
weatherText.text = EnviroSkyMgr.instance.GetCurrentWeatherPreset().Name;
|
||||
|
||||
temperatureText.text = EnviroSkyMgr.instance.GetCurrentTemperatureString();
|
||||
}
|
||||
|
||||
void LateUpdate ()
|
||||
{
|
||||
sliderTime.value = EnviroSkyMgr.instance.GetTimeOfDay() / 24f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a89661d4ad62330468d509839c6c6726
|
||||
timeCreated: 1436123154
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
namespace EnviroSamples
|
||||
{
|
||||
public class EventTest : MonoBehaviour {
|
||||
|
||||
void Start ()
|
||||
{
|
||||
EnviroSkyMgr.instance.OnWeatherChanged += (EnviroWeatherPreset type) =>
|
||||
{
|
||||
DoOnWeatherChange(type);
|
||||
|
||||
Debug.Log("Weather changed to: " + type.Name);
|
||||
};
|
||||
|
||||
|
||||
EnviroSkyMgr.instance.OnZoneChanged += (EnviroZone z) =>
|
||||
{
|
||||
DoOnZoneChange(z);
|
||||
|
||||
Debug.Log("ChangedZone: " + z.zoneName);
|
||||
};
|
||||
|
||||
|
||||
EnviroSkyMgr.instance.OnSeasonChanged += (EnviroSeasons.Seasons season) =>
|
||||
{
|
||||
Debug.Log("Season changed");
|
||||
};
|
||||
|
||||
EnviroSkyMgr.instance.OnHourPassed += () =>
|
||||
{
|
||||
Debug.Log("Hour Passed!");
|
||||
};
|
||||
|
||||
EnviroSkyMgr.instance.OnDayPassed += () =>
|
||||
{
|
||||
Debug.Log("New Day!");
|
||||
};
|
||||
EnviroSkyMgr.instance.OnYearPassed += () =>
|
||||
{
|
||||
Debug.Log("New Year!");
|
||||
};
|
||||
EnviroSkyMgr.instance.OnDayTime += () =>
|
||||
{
|
||||
Debug.Log("New Year!");
|
||||
};
|
||||
}
|
||||
|
||||
void DoOnWeatherChange (EnviroWeatherPreset type)
|
||||
{
|
||||
if(type.Name == "Light Rain")
|
||||
{
|
||||
|
||||
//Do something
|
||||
}
|
||||
}
|
||||
|
||||
void DoOnZoneChange(EnviroZone type)
|
||||
{
|
||||
if (type.zoneName == "Swamp")
|
||||
{
|
||||
|
||||
//Do something
|
||||
}
|
||||
}
|
||||
|
||||
public void TestEventsWWeather ()
|
||||
{
|
||||
print("Weather Changed though interface!");
|
||||
}
|
||||
|
||||
public void TestEventsNight ()
|
||||
{
|
||||
print("Night now!!");
|
||||
}
|
||||
|
||||
public void TestEventsDay ()
|
||||
{
|
||||
print("Day now!!");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07f770e87918f9641b5196575feff2c2
|
||||
timeCreated: 1455526543
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,48 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
namespace EnviroSamples
|
||||
{
|
||||
public class FPSController : MonoBehaviour {
|
||||
|
||||
public float speed = 2f;
|
||||
public float sensitivity = 2f;
|
||||
CharacterController player;
|
||||
|
||||
public GameObject eyes;
|
||||
|
||||
float moveFB;
|
||||
float moveLR;
|
||||
|
||||
float rotX;
|
||||
float rotY;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
player = GetComponent<CharacterController> ();
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
|
||||
moveFB = Input.GetAxis ("Vertical") * speed;
|
||||
moveLR = Input.GetAxis ("Horizontal") * speed;
|
||||
|
||||
rotX = Input.GetAxis ("Mouse X") * sensitivity;
|
||||
rotY -= Input.GetAxis ("Mouse Y") * sensitivity;
|
||||
|
||||
rotY = Mathf.Clamp (rotY, -60f, 60f);
|
||||
|
||||
Vector3 movement = new Vector3 (moveLR, 0, moveFB);
|
||||
transform.Rotate (0, rotX, 0);
|
||||
eyes.transform.localRotation = Quaternion.Euler(rotY, 0, 0);
|
||||
//eyes.transform.Rotate (-rotY, 0, 0);
|
||||
|
||||
movement = transform.rotation * movement;
|
||||
movement.y -= 4000f * Time.deltaTime;
|
||||
player.Move (movement * Time.deltaTime);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: aaa26f9af37e56b429b69fa2261e3d70
|
||||
timeCreated: 1487268843
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
namespace EnviroSamples
|
||||
{
|
||||
public class SampleHUDFPS : MonoBehaviour
|
||||
{
|
||||
// Attach this to any object to make a frames/second indicator.
|
||||
//
|
||||
// It calculates frames/second over each updateInterval,
|
||||
// so the display does not keep changing wildly.
|
||||
//
|
||||
// It is also fairly accurate at very low FPS counts (<10).
|
||||
// We do this not by simply counting frames per interval, but
|
||||
// by accumulating FPS for each frame. This way we end up with
|
||||
// corstartRect overall FPS even if the interval renders something like
|
||||
// 5.5 frames.
|
||||
|
||||
public Rect startRect = new Rect( 10, 10, 75, 50 ); // The rect the window is initially displayed at.
|
||||
public bool updateColor = true; // Do you want the color to change if the FPS gets low
|
||||
public bool allowDrag = true; // Do you want to allow the dragging of the FPS window
|
||||
public float frequency = 0.5F; // The update frequency of the fps
|
||||
public int nbDecimal = 1; // How many decimal do you want to display
|
||||
|
||||
private float accum = 0f; // FPS accumulated over the interval
|
||||
private int frames = 0; // Frames drawn over the interval
|
||||
private Color color = Color.white; // The color of the GUI, depending of the FPS ( R < 10, Y < 30, G >= 30 )
|
||||
private string sFPS = ""; // The fps formatted into a string.
|
||||
private GUIStyle style; // The style the text will be displayed at, based en defaultSkin.label.
|
||||
|
||||
void Start()
|
||||
{
|
||||
StartCoroutine( FPS() );
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
accum += Time.timeScale/ Time.deltaTime;
|
||||
++frames;
|
||||
}
|
||||
|
||||
IEnumerator FPS()
|
||||
{
|
||||
// Infinite loop executed every "frenquency" secondes.
|
||||
while( true )
|
||||
{
|
||||
// Update the FPS
|
||||
float fps = accum/frames;
|
||||
sFPS = fps.ToString( "f" + Mathf.Clamp( nbDecimal, 0, 10 ) );
|
||||
|
||||
//Update the color
|
||||
color = (fps >= 30) ? Color.green : ((fps > 10) ? Color.red : Color.yellow);
|
||||
|
||||
accum = 0.0F;
|
||||
frames = 0;
|
||||
|
||||
yield return new WaitForSeconds( frequency );
|
||||
}
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
// Copy the default label skin, change the color and the alignement
|
||||
if( style == null ){
|
||||
style = new GUIStyle( GUI.skin.label );
|
||||
style.normal.textColor = Color.white;
|
||||
style.alignment = TextAnchor.MiddleCenter;
|
||||
}
|
||||
|
||||
GUI.color = updateColor ? color : Color.white;
|
||||
startRect = GUI.Window(0, startRect, DoMyWindow, "");
|
||||
}
|
||||
|
||||
void DoMyWindow(int windowID)
|
||||
{
|
||||
GUI.Label( new Rect(0, 0, startRect.width, startRect.height), sFPS + " FPS", style );
|
||||
if( allowDrag ) GUI.DragWindow(new Rect(0, 0, Screen.width, Screen.height));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: acfdd41b90dc76d439e4d45a78574964
|
||||
timeCreated: 1446083131
|
||||
licenseType: Store
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user