mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Put in the dialogue stuff
This commit is contained in:
parent
62f5c8ef88
commit
1c40a8e664
38
NewHorizons/Builder/Props/DialogueBuilder.cs
Normal file
38
NewHorizons/Builder/Props/DialogueBuilder.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -32,6 +32,10 @@ namespace NewHorizons.Builder.Props
|
|||||||
GeyserBuilder.Make(go, sector, geyserInfo);
|
GeyserBuilder.Make(go, sector, geyserInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(config.Props.Rafts != null)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
if(config.Props.Tornados != null)
|
if(config.Props.Tornados != null)
|
||||||
{
|
{
|
||||||
foreach(var tornadoInfo in config.Props.Tornados)
|
foreach(var tornadoInfo in config.Props.Tornados)
|
||||||
@ -39,6 +43,13 @@ namespace NewHorizons.Builder.Props
|
|||||||
TornadoBuilder.Make(go, sector, tornadoInfo, config.Atmosphere?.Cloud != null);
|
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)
|
public static GameObject LoadPrefab(string assetBundle, string path, string uniqueModName, IModAssets assets)
|
||||||
|
|||||||
8
NewHorizons/External/PropModule.cs
vendored
8
NewHorizons/External/PropModule.cs
vendored
@ -14,6 +14,7 @@ namespace NewHorizons.External
|
|||||||
public RaftInfo[] Rafts;
|
public RaftInfo[] Rafts;
|
||||||
public GeyserInfo[] Geysers;
|
public GeyserInfo[] Geysers;
|
||||||
public TornadoInfo[] Tornados;
|
public TornadoInfo[] Tornados;
|
||||||
|
public DialogueInfo[] Dialogue;
|
||||||
|
|
||||||
public class ScatterInfo
|
public class ScatterInfo
|
||||||
{
|
{
|
||||||
@ -57,5 +58,12 @@ namespace NewHorizons.External
|
|||||||
public float width;
|
public float width;
|
||||||
public MColor tint;
|
public MColor tint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class DialogueInfo
|
||||||
|
{
|
||||||
|
public MVector3 position;
|
||||||
|
public float radius;
|
||||||
|
public string xmlFile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user