add weather and time
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace Enviro
|
||||
{
|
||||
[Serializable]
|
||||
public class EnviroDefault
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class EnviroDefaultModule : EnviroModule
|
||||
{
|
||||
public Enviro.EnviroDefault settings;
|
||||
public EnviroDefaultModule preset;
|
||||
public bool showDefaultControls;
|
||||
|
||||
|
||||
// Update Method
|
||||
public override void UpdateModule ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//Save and Load
|
||||
public void LoadModuleValues ()
|
||||
{
|
||||
if(preset != null)
|
||||
{
|
||||
settings = JsonUtility.FromJson<Enviro.EnviroDefault>(JsonUtility.ToJson(preset.settings));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("Please assign a saved module to load from!");
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveModuleValues ()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
EnviroDefaultModule t = ScriptableObject.CreateInstance<EnviroDefaultModule>();
|
||||
t.name = "Default Preset";
|
||||
t.settings = JsonUtility.FromJson<Enviro.EnviroDefault>(JsonUtility.ToJson(settings));
|
||||
|
||||
string assetPathAndName = UnityEditor.AssetDatabase.GenerateUniqueAssetPath(EnviroHelper.assetPath + "/New " + t.name + ".asset");
|
||||
UnityEditor.AssetDatabase.CreateAsset(t, assetPathAndName);
|
||||
UnityEditor.AssetDatabase.SaveAssets();
|
||||
UnityEditor.AssetDatabase.Refresh();
|
||||
#endif
|
||||
}
|
||||
public void SaveModuleValues (EnviroDefaultModule module)
|
||||
{
|
||||
module.settings = JsonUtility.FromJson<Enviro.EnviroDefault>(JsonUtility.ToJson(settings));
|
||||
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorUtility.SetDirty(module);
|
||||
UnityEditor.AssetDatabase.SaveAssets();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f09341d4288862d4c869629f4b229df9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
AssetOrigin:
|
||||
serializedVersion: 1
|
||||
productId: 236601
|
||||
packageName: Enviro 3 - Sky and Weather
|
||||
packageVersion: 3.1.2
|
||||
assetPath: Assets/Enviro 3 - Sky and Weather/Scripts/Runtime/Modules/Default/EnviroDefaultModule.cs
|
||||
uploadId: 660896
|
||||
Reference in New Issue
Block a user