Put in the dialogue stuff

This commit is contained in:
Nick J. Connors 2022-01-31 18:32:03 -05:00
parent 62f5c8ef88
commit 1c40a8e664
3 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,38 @@
using NewHorizons.External;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace NewHorizons.Builder.Props
{
public static class DialogueBuilder
{
public static void Make(GameObject go, Sector sector, PropModule.DialogueInfo info)
{
GameObject conversationZone = new GameObject("ConversationZone");
conversationZone.SetActive(false);
conversationZone.layer = LayerMask.NameToLayer("Interactible");
var sphere = conversationZone.AddComponent<SphereCollider>();
sphere.radius = info.radius;
sphere.isTrigger = true;
conversationZone.AddComponent<OWCollider>();
var dialogueTree = conversationZone.AddComponent<CharacterDialogueTree>();
// XML STUFF GOES HERE
conversationZone.transform.parent = sector.transform;
conversationZone.transform.localPosition = Vector3.zero;
conversationZone.SetActive(true);
}
}
}

View File

@ -32,6 +32,10 @@ namespace NewHorizons.Builder.Props
GeyserBuilder.Make(go, sector, geyserInfo);
}
}
if(config.Props.Rafts != null)
{
// TODO
}
if(config.Props.Tornados != null)
{
foreach(var tornadoInfo in config.Props.Tornados)
@ -39,6 +43,13 @@ namespace NewHorizons.Builder.Props
TornadoBuilder.Make(go, sector, tornadoInfo, config.Atmosphere?.Cloud != null);
}
}
if(config.Props.Dialogue != null)
{
foreach(var dialogueInfo in config.Props.Dialogue)
{
DialogueBuilder.Make(go, sector, dialogueInfo);
}
}
}
public static GameObject LoadPrefab(string assetBundle, string path, string uniqueModName, IModAssets assets)

View File

@ -14,6 +14,7 @@ namespace NewHorizons.External
public RaftInfo[] Rafts;
public GeyserInfo[] Geysers;
public TornadoInfo[] Tornados;
public DialogueInfo[] Dialogue;
public class ScatterInfo
{
@ -57,5 +58,12 @@ namespace NewHorizons.External
public float width;
public MColor tint;
}
public class DialogueInfo
{
public MVector3 position;
public float radius;
public string xmlFile;
}
}
}