diff --git a/Assets/Scripts/World/World.cs b/Assets/Scripts/World/World.cs new file mode 100644 index 0000000..d94bd91 --- /dev/null +++ b/Assets/Scripts/World/World.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using Sirenix.OdinInspector; +using UnityEngine; + +namespace Reset.World{ + public class World{ + public List zones = new List(); + public List activeEvents = new List(); + + public static List ZoneEventsMasterList; + + void Start(){ + + } + + // Update is called once per frame + void Update(){ + + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/World/World.cs.meta b/Assets/Scripts/World/World.cs.meta new file mode 100644 index 0000000..9f29967 --- /dev/null +++ b/Assets/Scripts/World/World.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: d524946cf105ebe47ab710cddf19e4f8 \ No newline at end of file diff --git a/Assets/Scripts/World/Zone.cs b/Assets/Scripts/World/Zone.cs new file mode 100644 index 0000000..b1de64f --- /dev/null +++ b/Assets/Scripts/World/Zone.cs @@ -0,0 +1,27 @@ +using Reset.World; +using UnityEngine; +public class Zone : MonoBehaviour{ + public ZoneEvent activeEvent; + + void Start() + { + + } + + public bool TryNewEvent(){ + int eventIndex = Random.Range(0, World.ZoneEventsMasterList.Count); + + if (Random.value * 100 < World.ZoneEventsMasterList[eventIndex].eventRarity) { + activeEvent = World.ZoneEventsMasterList[eventIndex]; + return true; + } + + return false; + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scripts/World/Zone.cs.meta b/Assets/Scripts/World/Zone.cs.meta new file mode 100644 index 0000000..3602b1a --- /dev/null +++ b/Assets/Scripts/World/Zone.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 787d3d76f34dc6d40aeac24af98bc27d \ No newline at end of file diff --git a/Assets/Scripts/World/ZoneEvent.cs b/Assets/Scripts/World/ZoneEvent.cs new file mode 100644 index 0000000..e1e2642 --- /dev/null +++ b/Assets/Scripts/World/ZoneEvent.cs @@ -0,0 +1,9 @@ +using NUnit.Framework; +using Sirenix.OdinInspector; + +namespace Reset.World{ + public class ZoneEvent{ + [PropertyRange(0, 100)] + public float eventRarity; + } +} \ No newline at end of file diff --git a/Assets/Scripts/World/ZoneEvent.cs.meta b/Assets/Scripts/World/ZoneEvent.cs.meta new file mode 100644 index 0000000..71f0faa --- /dev/null +++ b/Assets/Scripts/World/ZoneEvent.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9b045a48fc77475389d1f1eca177aed9 +timeCreated: 1759349742 \ No newline at end of file