added: World, Zone and ZoneEvent classes for world systems
This commit is contained in:
27
Assets/Scripts/World/Zone.cs
Normal file
27
Assets/Scripts/World/Zone.cs
Normal 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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user