added: World, Zone and ZoneEvent classes for world systems

This commit is contained in:
Chris
2025-10-23 18:09:46 -04:00
parent 47b4530dd0
commit fee7b3701e
6 changed files with 64 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
using System.Collections.Generic;
using Sirenix.OdinInspector;
using UnityEngine;
namespace Reset.World{
public class World{
public List<Zone> zones = new List<Zone>();
public List<ZoneEvent> activeEvents = new List<ZoneEvent>();
public static List<ZoneEvent> ZoneEventsMasterList;
void Start(){
}
// Update is called once per frame
void Update(){
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d524946cf105ebe47ab710cddf19e4f8

View File

@@ -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()
{
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 787d3d76f34dc6d40aeac24af98bc27d

View File

@@ -0,0 +1,9 @@
using NUnit.Framework;
using Sirenix.OdinInspector;
namespace Reset.World{
public class ZoneEvent{
[PropertyRange(0, 100)]
public float eventRarity;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 9b045a48fc77475389d1f1eca177aed9
timeCreated: 1759349742