Added part of the encounter triggering system

This commit is contained in:
Sebastian Bularca
2026-04-27 00:01:15 +02:00
parent f117ddb914
commit ea6c28bfba
28 changed files with 20336 additions and 185 deletions

View File

@@ -246,6 +246,11 @@ MonoBehaviour:
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: fdfc8d602281a0b45bbd7c08cb41f727
m_Address: EncounterPrefabs
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: fe393ace9b354375a9cb14cdbbc28be4
m_Address: Assets/TextMesh Pro/Shaders/TMP_SDF-Mobile.shader
m_ReadOnly: 0

View File

@@ -1,4 +1,5 @@
using Jovian.Calendar;
using Jovian.EncounterSystem;
using Jovian.PopupSystem;
using Jovian.PopupSystem.UI;
using Jovian.SaveSystem;
@@ -43,6 +44,9 @@ namespace Nox.Game {
private PartyInventoryHandler partyInventoryHandler;
private PartyGuiView partyGuiView;
private IPopupSystem popupSystem;
private EncounterRegistry encounterRegistry;
private EncounterHandler encounterHandler;
private EncounterPrefabs encounterPrefabs;
public AdventurePlayMode(
PlatformSettings platformSettings,
@@ -103,7 +107,9 @@ namespace Nox.Game {
Debug.LogWarning("AdventurePlayMode started from the Adventure Scene. Loading the last Autosave");
}
encounterRegistry ??= Addressables.LoadAssetAsync<EncounterRegistry>("EncounterRegistry").WaitForCompletion();
scenePrefabs ??= Addressables.LoadAssetAsync<AdventureModePrefabs>("AdventureMapPrefabs").WaitForCompletion();
encounterPrefabs = Addressables.LoadAssetAsync<EncounterPrefabs>("EncounterPrefabs").WaitForCompletion();
mapRef ??= Object.FindFirstObjectByType<MapReference>();
partyRef ??= Object.FindFirstObjectByType<PartyReference>();
if(partyRef && gameDataState.savedPartyPosition.HasValue) {
@@ -129,9 +135,17 @@ namespace Nox.Game {
var calendarSettings = Addressables.LoadAssetAsync<CalendarSettings>("CalendarSettings").WaitForCompletion();
var worldClock = new WorldClock(calendarSettings);
timeHandler ??= new TimeHandler(adventureSettings, adventureData, worldClock);
zoneSystem ??= new ZoneSystem(mapRef.zonesObjectHolder);
partyMovementHandler ??= new PartyMovementHandler(partyRef, cameraController, mapLocationsReference, platformSettings.inputSettings, zoneSystem, adventureData, adventureSettings);
zoneSystem ??= new ZoneSystem(mapRef.zonesObjectHolder);
encounterHandler = new EncounterHandler(zoneSystem, encounterRegistry, encounterPrefabs, adventureData);
partyMovementHandler ??= new PartyMovementHandler(
partyRef,
cameraController,
mapLocationsReference,
platformSettings.inputSettings,
encounterHandler,
adventureData,
adventureSettings);
partyMovementHandler.Initialize();
guiReferences ??= Object.FindFirstObjectByType<GuiReferences>();
@@ -164,6 +178,7 @@ namespace Nox.Game {
timeHandler.Tick();
partyInventoryHandler.Tick();
partyMovementHandler.Tick();
encounterHandler.Tick();
adventureView.Tick();
partyGuiView?.Tick();
popupSystem?.Tick(Time.deltaTime);
@@ -191,10 +206,14 @@ namespace Nox.Game {
inputActions.UI.PauseMenu.Disable();
}
public void Dispose() {
cameraController?.Dispose();
partyMovementHandler?.Dispose();
partyGuiView?.Dispose();
popupSystem?.Dispose();
cameraController?.Dispose();
partyMovementHandler?.Dispose();
encounterHandler?.Dispose();
encounterRegistry = null;
Resources.UnloadUnusedAssets();
}
}

View File

@@ -0,0 +1,9 @@
using TMPro;
using UnityEngine;
namespace Nox.Game {
public class AnswerPrefab : MonoBehaviour {
public TextMeshProUGUI number;
public TextMeshProUGUI dialogText;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 0c14350aeeed44a28d98d22c6ef048dc
timeCreated: 1777235448

View File

@@ -1,7 +1,100 @@
using System;
using Jovian.EncounterSystem;
using Jovian.ZoneSystem;
using UnityEngine;
namespace Nox.Game {
public class EncounterHandler {
private readonly ZoneSystem zoneSystem;
private readonly EncounterRegistry encounterRegistry;
private readonly AdventureData adventureData;
private readonly EncounterView encounterView;
private string previousZoneId;
private int previousDay;
public EncounterHandler(ZoneSystem zoneSystem, EncounterRegistry encounterRegistry, EncounterPrefabs encounterPrefabs, AdventureData adventureData) {
this.zoneSystem = zoneSystem;
this.encounterRegistry = encounterRegistry;
this.adventureData = adventureData;
encounterView = new EncounterView(encounterPrefabs);
}
public bool AskForRandomEncounter(ZoneContext zoneContext, string encounterTableId, out IEncounter encounter) {
return ResolveEncounter(zoneContext, encounterTableId, out encounter);
}
public bool AskForRandomEncounterOfType(ZoneContext zoneContext, string encounterTableId, out IEncounter encounter, IEncounterKind encounterKind) {
return ResolveEncounter(zoneContext, encounterTableId, out encounter, encounterKind);
}
public bool AskForEncounter(string encounterId, out IEncounter encounter) {
return encounterRegistry.GetEncounters().TryGetValue(encounterId, out encounter);
}
private bool ResolveEncounter(ZoneContext zoneContext, string encounterTableId, out IEncounter encounter, IEncounterKind encounterKind = null) {
encounter = null;
if(zoneContext.isSafe) {
return false;
}
var randomChance = Random.Range(0f, 1f);
var shouldTrigger = randomChance <= zoneContext.finalEncounterChance;
if(!shouldTrigger) {
return false;
}
if(encounterKind == null) {
encounter = encounterRegistry.GetRandomEncounter(encounterTableId);
return encounter != null;
}
encounter = encounterRegistry.GetRandomEncounter(encounterTableId, encounterKind);
return encounter != null;
}
private void VerifyZones(Vector3 position) {
var zoneContext = zoneSystem.QueryZone(position);
if(string.IsNullOrEmpty(zoneContext.resolvedZoneId)) {
return;
}
var currentZoneId = zoneContext.resolvedZoneId;
if(currentZoneId != previousZoneId) {
if(!string.IsNullOrEmpty(currentZoneId)) {
Debug.Log($"Entered zone: {currentZoneId} (encounter: {zoneContext.encounterTableId}, safe: {zoneContext.isSafe})");
if(ResolveEncounter(zoneContext, currentZoneId, out var encounter)) {
TriggerEncounter(encounter);
}
}
else if(!string.IsNullOrEmpty(previousZoneId)) {
Debug.Log($"Left zone: {previousZoneId}");
}
previousZoneId = currentZoneId;
}
}
private void TriggerEncounter(IEncounter encounter) {
switch(encounter.EncounterDefinition.Kind) {
case CombatKind:
return;
default:
encounterView?.SetCurrentEncounter(encounter);
encounterView?.Show();
break;
}
}
public void CheckForEncounters(Vector3 position) {
if (adventureData.currentDay != previousDay) {
VerifyZones(position);
}
}
public void Tick() { }
public void Dispose() {
// nothing here
}
}
}

View File

@@ -3,40 +3,23 @@ using System;
namespace Nox.Game {
[Serializable]
public class CombatKind : IEncounterKind {
public string enemyGroupId;
public string rewardTableId;
}
public class CombatKind : IEncounterKind { }
[Serializable]
public class SocialKind : IEncounterKind {
public string npcId;
public string factionId;
public int reputationDelta;
}
public class SocialKind : IEncounterKind { }
[Serializable]
public class PuzzleKind : IEncounterKind {
public string puzzleId;
public int difficultyClass;
}
public class PuzzleKind : IEncounterKind { }
[Serializable]
public class ExplorationKind : IEncounterKind {
public int perceptionDC;
}
public class ExplorationKind : IEncounterKind { }
[Serializable]
public class TutorialKind : IEncounterKind {
public string tutorialId;
}
public class TutorialKind : IEncounterKind { }
[Serializable]
public class HazardKind : IEncounterKind {
public int damageAmount;
}
public class HazardKind : IEncounterKind { }
[Serializable]
public class OtherKind : IEncounterKind {
}
public class OtherKind : IEncounterKind { }
}

View File

@@ -0,0 +1,18 @@
using Jovian.EncounterSystem;
using System;
using UnityEngine;
namespace Nox.Game {
[CreateAssetMenu(fileName = "EncounterPrefabs", menuName = "Nox/EncounterPrefabs")]
public class EncounterPrefabs : ScriptableObject {
public EncounterSet[] encounterSets;
public AnswerPrefab answerPrefab;
}
[Serializable]
public class EncounterSet {
[field: SerializeReference, SubclassSelector]
public IEncounterKind encounterKind;
public EncounterReference encounterReference;
}
}

View File

@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7fc36c84acd04836b1280aba57a64e24
timeCreated: 1777229589

View File

@@ -1,19 +1,43 @@
using Jovian.EncounterSystem;
using Nox.Game.UI;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Nox.Game {
public class EncounterView : IMenuView{
private readonly EncounterPrefabs encounterPrefabs;
private readonly IEncounterKind encounterKind;
private IEncounter currentEncounter;
public void Initialize() {
throw new System.NotImplementedException();
private Dictionary<IEncounterKind, EncounterReference> encounterKindToPrefab = new ();
private IEncounterKind currentActiveKind;
public EncounterView(EncounterPrefabs encounterPrefabs) {
this.encounterPrefabs = encounterPrefabs;
}
public void SetCurrentEncounter(IEncounter encounter) {
currentEncounter = encounter;
if(!encounterKindToPrefab.TryGetValue(encounter.EncounterDefinition.Kind, out var encounterReference)) {
encounterReference = Object.Instantiate(encounterPrefabs.encounterSets.FirstOrDefault(e => e.encounterKind == encounterKind)?.encounterReference);
encounterKindToPrefab.Add(encounter.EncounterDefinition.Kind, encounterReference);
}
}
public void Initialize() { }
public void Show() {
throw new System.NotImplementedException();
currentActiveKind = currentEncounter.EncounterDefinition.Kind;
PopulateEncounterReference();
encounterKindToPrefab[currentActiveKind].gameObject.SetActive(true);
}
private void PopulateEncounterReference() {
}
public void Hide() {
throw new System.NotImplementedException();
}
public void Tick() {
throw new System.NotImplementedException();
encounterKindToPrefab[currentActiveKind].gameObject.SetActive(false);
}
public void Tick() { }
}
}

View File

@@ -1,4 +1,3 @@
using Jovian.ZoneSystem;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.InputSystem;
@@ -9,12 +8,11 @@ namespace Nox.Game {
private readonly ICameraController cameraController;
private readonly InputSystem_Actions inputActions;
private readonly MapLocationsReference mapLocationsReference;
private readonly ZoneSystem zoneSystem;
private readonly EncounterHandler encounterHandler;
private readonly AdventureSettings adventureSettings;
private readonly float maxDistance = 100f;
private readonly AdventureData adventureData;
private AdventureData adventureData;
private bool partyCanMove;
private Vector3 targetPosition;
private bool shouldHover;
@@ -31,16 +29,15 @@ namespace Nox.Game {
ICameraController cameraController,
MapLocationsReference mapLocationsReference,
Input.InputSettings inputSettings,
ZoneSystem zoneSystem,
EncounterHandler encounterHandler,
AdventureData adventureData,
AdventureSettings adventureSettings) {
this.partyReference = partyReference;
this.cameraController = cameraController;
this.mapLocationsReference = mapLocationsReference;
this.zoneSystem = zoneSystem;
this.encounterHandler = encounterHandler;
this.adventureData = adventureData;
this.adventureSettings = adventureSettings;
inputActions = inputSettings.inputActions;
}
@@ -77,10 +74,14 @@ namespace Nox.Game {
if(!clickHit.collider.gameObject.transform.parent.TryGetComponent(out MapReference mapReference)) {
return;
}
//if(mapReference.ValidateMoveLocation(hitInfoPoint)) {
targetPosition = clickHit.point;
partyCanMove = true;
//}
if(ValidateMoveLocation(clickHit)) {
targetPosition = clickHit.point;
partyCanMove = true;
}
}
private bool ValidateMoveLocation(object hitInfoPoint) {
return true;
}
public void Tick() {
@@ -109,9 +110,13 @@ namespace Nox.Game {
VerifyPointsOfInterest();
partyCanMove = false;
}
adventureData.isPartyMoving = true;
partyReference.transform.position = Vector3.MoveTowards(new Vector3(partyReference.transform.position.x, 0, partyReference.transform.position.z), targetPosition, Time.deltaTime * adventureSettings.partyBaseSpeed);
VerifyZones(partyReference.transform.position);
partyReference.transform.position = Vector3.MoveTowards(
new Vector3(partyReference.transform.position.x, 0,
partyReference.transform.position.z), targetPosition,
Time.deltaTime * adventureSettings.partyBaseSpeed);
encounterHandler?.CheckForEncounters(partyReference.transform.position);
}
private void HandleHover() {
@@ -128,20 +133,6 @@ namespace Nox.Game {
currentSelectedPoi = null;
}
}
private void VerifyZones(Vector3 position) {
var zoneContext = zoneSystem.QueryZone(position);
var currentZoneId = zoneContext.resolvedZoneId;
if(currentZoneId != previousZoneId) {
if(!string.IsNullOrEmpty(currentZoneId)) {
Debug.Log($"Entered zone: {currentZoneId} (encounter: {zoneContext.encounterTableId}, safe: {zoneContext.isSafe})");
}
else if(!string.IsNullOrEmpty(previousZoneId)) {
Debug.Log($"Left zone: {previousZoneId}");
}
previousZoneId = currentZoneId;
}
}
private void VerifyPointsOfInterest() {
foreach(var location in mapLocationsReference.mapLocations) {
@@ -156,5 +147,4 @@ namespace Nox.Game {
inputActions.Player.ClickOnMap.performed -= OnClickOnMap;
}
}
}

View File

@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7fc36c84acd04836b1280aba57a64e24, type: 3}
m_Name: EncounterPrefabs
m_EditorClassIdentifier: Assembly-CSharp::Nox.Game.EncounterPrefabs
encounterSets:
- encounterKind:
rid: 1352971649185742937
encounterReference: {fileID: 3705563528526877357, guid: 62525e62adc83b84abde85d78828de2b, type: 3}
answerPrefab: {fileID: -3146704326252051464, guid: cbecff27dee2cf7448a05a89ecb018b4, type: 3}
references:
version: 2
RefIds:
- rid: 1352971649185742937
type: {class: ExplorationKind, ns: Nox.Game, asm: Assembly-CSharp}
data:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fdfc8d602281a0b45bbd7c08cb41f727
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -19,7 +19,7 @@ MonoBehaviour:
debugColor: {r: 0, g: 0.7563188, b: 1, a: 0.25}
encounterTableId: Adventure_Random_Easy
baseDifficultyTier: 1
baseEncounterChance: 0.1
baseEncounterChance: 1
encounterChanceMultiplier: 1
difficultyTierBonus: 0
isSafeZone: 0

View File

@@ -0,0 +1,359 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1774939147060596866
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1760747944163223242}
- component: {fileID: 3503963276009221598}
- component: {fileID: 572009535857796838}
m_Layer: 5
m_Name: nr
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1760747944163223242
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1774939147060596866}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5249586234698548752}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 33.7117, y: -11.996}
m_SizeDelta: {x: 21.0224, y: 24.1}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3503963276009221598
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1774939147060596866}
m_CullTransparentMesh: 1
--- !u!114 &572009535857796838
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1774939147060596866}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 1.
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_sharedMaterial: {fileID: 9074173216178389243, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278783248
m_fontColor: {r: 0.0627451, g: 0.050980397, b: 0.03529412, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 12
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 2.6
m_fontSizeMax: 12
m_fontStyle: 0
m_HorizontalAlignment: 4
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 2.668274, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5906514193138747816
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5249586234698548752}
- component: {fileID: 6966740546070481897}
- component: {fileID: 1953891385698885950}
- component: {fileID: -3146704326252051464}
m_Layer: 5
m_Name: Answers
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5249586234698548752
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5906514193138747816}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1760747944163223242}
- {fileID: 7428637175488290741}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 192.33157, y: -11.602112}
m_SizeDelta: {x: 384.6631, y: 24.0463}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6966740546070481897
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5906514193138747816}
m_CullTransparentMesh: 1
--- !u!114 &1953891385698885950
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5906514193138747816}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.LayoutElement
m_IgnoreLayout: 0
m_MinWidth: -1
m_MinHeight: -1
m_PreferredWidth: -1
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!114 &-3146704326252051464
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5906514193138747816}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0c14350aeeed44a28d98d22c6ef048dc, type: 3}
m_Name:
m_EditorClassIdentifier: Assembly-CSharp::Nox.Game.AnswerPrefab
number: {fileID: 572009535857796838}
dialogText: {fileID: 3412282869295099737}
--- !u!1 &6684607543305325759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7428637175488290741}
- component: {fileID: 8466763491809017645}
- component: {fileID: 3412282869295099737}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7428637175488290741
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6684607543305325759}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5249586234698548752}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 214.33, y: -12.023}
m_SizeDelta: {x: 340.22, y: 24.046}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8466763491809017645
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6684607543305325759}
m_CullTransparentMesh: 1
--- !u!114 &3412282869295099737
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6684607543305325759}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Charge The Line Charge The Line Charge The Line Charge The Line Charge
The Line Charge The Line Charge The Line Charge The Line Charge The Line Charge
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_sharedMaterial: {fileID: 9074173216178389243, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4278783248
m_fontColor: {r: 0.0627451, g: 0.050980397, b: 0.03529412, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 8.9
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 2.6
m_fontSizeMax: 12
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 7.1723022, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cbecff27dee2cf7448a05a89ecb018b4
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,697 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3617559978782513519
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8477970123459414041}
- component: {fileID: 3077754775864774321}
- component: {fileID: 3649549507639781181}
m_Layer: 5
m_Name: Mask
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8477970123459414041
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3617559978782513519}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 7039252932434566139}
m_Father: {fileID: 7107336662030716891}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3077754775864774321
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3617559978782513519}
m_CullTransparentMesh: 1
--- !u!114 &3649549507639781181
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3617559978782513519}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3853719035858582054
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4900680696536290555}
- component: {fileID: 502023626210869990}
- component: {fileID: 6074527782412359595}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4900680696536290555
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3853719035858582054}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7039252932434566139}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.48286262}
m_AnchorMax: {x: 0.6627312, y: 1}
m_AnchoredPosition: {x: 0.9819946, y: -38.289}
m_SizeDelta: {x: 1.62, y: -42.331}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &502023626210869990
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3853719035858582054}
m_CullTransparentMesh: 1
--- !u!114 &6074527782412359595
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3853719035858582054}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: A group of Gargoyles has blocked the road. They are chanting abd blah
bla
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_sharedMaterial: {fileID: 9074173216178389243, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4279507489
m_fontColor: {r: 0.12941177, g: 0.10196079, b: 0.078431375, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 13.1
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 7.8
m_fontSizeMax: 13.1
m_fontStyle: 0
m_HorizontalAlignment: 1
m_VerticalAlignment: 256
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 26.800018, y: 6.367523, z: 6.807068, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4043707640276751891
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 565728455484042611}
- component: {fileID: 2681516528620939688}
- component: {fileID: 1883240519542694916}
m_Layer: 5
m_Name: Art
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &565728455484042611
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4043707640276751891}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7039252932434566139}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.6627312, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -14.5, y: 0.000015258789}
m_SizeDelta: {x: -32.578293, y: -65.75531}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2681516528620939688
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4043707640276751891}
m_CullTransparentMesh: 1
--- !u!114 &1883240519542694916
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4043707640276751891}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 6cb6255ee69dbf04abe2eac591388adf, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4690676139639527418
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5610124364099563801}
- component: {fileID: 3458576624150439327}
- component: {fileID: 1362417063745413028}
m_Layer: 5
m_Name: Title
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5610124364099563801
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4690676139639527418}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7039252932434566139}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.8264123}
m_AnchorMax: {x: 0.6627312, y: 1}
m_AnchoredPosition: {x: -0.80999756, y: -15.64299}
m_SizeDelta: {x: 1.62, y: -33.7364}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3458576624150439327
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4690676139639527418}
m_CullTransparentMesh: 1
--- !u!114 &1362417063745413028
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4690676139639527418}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.TextMeshPro::TMPro.TextMeshProUGUI
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Encounter Title
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_sharedMaterial: {fileID: 9074173216178389243, guid: a0ee74bf6f853704a8a568d5ef638ee9, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4279507489
m_fontColor: {r: 0.12941177, g: 0.10196079, b: 0.078431375, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 26.9
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 6.97
m_fontSizeMax: 45.4
m_fontStyle: 1
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_characterHorizontalScale: 1
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_TextWrappingMode: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 0
m_ActiveFontFeatures: 6e72656b
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_EmojiFallbackSupport: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 21.254028, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &4791155219053449426
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4897385661531424469}
- component: {fileID: 7326620177005582428}
- component: {fileID: 7295291249677778017}
m_Layer: 5
m_Name: AnswersContainer
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4897385661531424469
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4791155219053449426}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7039252932434566139}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.6627312, y: 0.43427482}
m_AnchoredPosition: {x: 0.9819946, y: 13.1859}
m_SizeDelta: {x: 1.62, y: -26.6202}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7326620177005582428
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4791155219053449426}
m_CullTransparentMesh: 1
--- !u!114 &7295291249677778017
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4791155219053449426}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.VerticalLayoutGroup
m_Padding:
m_Left: 0
m_Right: 0
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 0
m_Spacing: 1
m_ChildForceExpandWidth: 1
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 0
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1 &6989683072839887398
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7107336662030716891}
- component: {fileID: 5489237150592293923}
- component: {fileID: 5723139269595044}
- component: {fileID: 1343977848673373576}
- component: {fileID: 3705563528526877357}
m_Layer: 5
m_Name: EncounterReference
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7107336662030716891
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6989683072839887398}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8477970123459414041}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!223 &5489237150592293923
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6989683072839887398}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 1
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 100
m_TargetDisplay: 0
--- !u!114 &5723139269595044
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6989683072839887398}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.CanvasScaler
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!114 &1343977848673373576
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6989683072839887398}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.GraphicRaycaster
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &3705563528526877357
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6989683072839887398}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0173ea7fbf1e45b1932694938ecd3058, type: 3}
m_Name:
m_EditorClassIdentifier: Jovian.EncounterSystem::Jovian.EncounterSystem.EncounterReference
encounterName: {fileID: 1362417063745413028}
encounterDescription: {fileID: 6074527782412359595}
encounterArt: {fileID: 1883240519542694916}
encounterOptionsContainer: {fileID: 4897385661531424469}
--- !u!1 &8084146734087207726
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7039252932434566139}
- component: {fileID: 7810011449154573601}
- component: {fileID: 4925850881383289972}
m_Layer: 5
m_Name: Background
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7039252932434566139
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8084146734087207726}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 565728455484042611}
- {fileID: 5610124364099563801}
- {fileID: 4900680696536290555}
- {fileID: 4897385661531424469}
m_Father: {fileID: 8477970123459414041}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -510.3443, y: -262.6666}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7810011449154573601
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8084146734087207726}
m_CullTransparentMesh: 1
--- !u!114 &4925850881383289972
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8084146734087207726}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.7882353}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 52125a3c3df558448a5af5a04dbf8d2d, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 62525e62adc83b84abde85d78828de2b
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,3 @@
using Jovian.EncounterSystem;
using UnityEditor;
using UnityEngine;

View File

@@ -9,6 +9,5 @@ namespace Jovian.EncounterSystem {
public TextMeshProUGUI encounterDescription;
public Image encounterArt;
public Transform encounterOptionsContainer;
public Button submitButton;
}
}

View File

@@ -56,6 +56,73 @@ namespace Jovian.EncounterSystem {
}
}
}
public EncounterTable GetEncounterTable(string id) {
foreach(var collection in encounterCollections) {
foreach(var table in collection.encounterTables) {
if(table.id == id) {
return table;
}
}
}
return null;
}
public IEncounter GetRandomEncounter(string encounterTableId) {
var table = GetEncounterTable(encounterTableId);
if(!table) {
return null;
}
var ec = table.encounters;
return ec[UnityEngine.Random.Range(0, ec.Count)];
}
/// <summary>Random pick restricted to encounters whose runtime type matches <paramref name="type"/>.
/// Zero-alloc — uses reservoir sampling instead of building an intermediate filtered list.</summary>
public IEncounter GetRandomEncounter(string encounterTableId, IEncounterKind encounterKind) {
var table = GetEncounterTable(encounterTableId);
if(!table || encounterKind == null) {
return null;
}
IEncounter selected = null;
var seen = 0;
for(var i = 0; i < encounters.Count; i++) {
var encounter = table.encounters[i];
if(encounter == null || encounter.GetType() != encounterKind.GetType()) {
continue;
}
seen++;
if(UnityEngine.Random.Range(0, seen) == 0) {
selected = encounter;
}
}
return selected;
}
/// <summary>Random pick restricted by <paramref name="filter"/>. Used with
/// <see cref="QuestProgress.IsGated"/> to exclude gated encounters. Zero-alloc via reservoir sampling.</summary>
public IEncounter GetRandomEncounter(Predicate<IEncounter> filter, string encounterTableId) {
var table = GetEncounterTable(encounterTableId);
if(!table) {
return null;
}
if(filter == null) {
return GetRandomEncounter(encounterTableId);
}
IEncounter selected = null;
var seen = 0;
foreach(var encounter in table.encounters) {
if(encounter == null || !filter(encounter)) {
continue;
}
seen++;
if(UnityEngine.Random.Range(0, seen) == 0) {
selected = encounter;
}
}
return selected;
}
}
#if UNITY_EDITOR

View File

@@ -26,61 +26,6 @@ namespace Jovian.EncounterSystem {
idCache = null;
}
public IEncounter GetRandomEncounter() {
if(encounters == null || encounters.Count == 0) {
return null;
}
return encounters[UnityEngine.Random.Range(0, encounters.Count)];
}
/// <summary>Random pick restricted to encounters whose runtime type matches <paramref name="type"/>.
/// Zero-alloc — uses reservoir sampling instead of building an intermediate filtered list.</summary>
public IEncounter GetRandomEncounter(Type type) {
if(encounters == null || encounters.Count == 0 || type == null) {
return null;
}
IEncounter selected = null;
var seen = 0;
for(var i = 0; i < encounters.Count; i++) {
var encounter = encounters[i];
if(encounter == null || encounter.GetType() != type) {
continue;
}
seen++;
if(UnityEngine.Random.Range(0, seen) == 0) {
selected = encounter;
}
}
return selected;
}
/// <summary>Random pick restricted by <paramref name="filter"/>. Used with
/// <see cref="QuestProgress.IsGated"/> to exclude gated encounters. Zero-alloc via reservoir sampling.</summary>
public IEncounter GetRandomEncounter(Predicate<IEncounter> filter) {
if(encounters == null || encounters.Count == 0) {
return null;
}
if(filter == null) {
return GetRandomEncounter();
}
IEncounter selected = null;
var seen = 0;
for(var i = 0; i < encounters.Count; i++) {
var encounter = encounters[i];
if(encounter == null || !filter(encounter)) {
continue;
}
seen++;
if(UnityEngine.Random.Range(0, seen) == 0) {
selected = encounter;
}
}
return selected;
}
private void EnsureCache() {
if(idCache != null) {
return;

View File

@@ -3,11 +3,10 @@ using System;
namespace Jovian.EncounterSystem {
/// <summary>Polymorphic payload on an <see cref="IEncounter"/>. Add a new kind by implementing
/// this interface; the SubclassSelector drawer surfaces it automatically.</summary>
public interface IEncounterKind {
}
public interface IEncounterKind { }
[Serializable]
public partial class QuestKind : IEncounterKind {
public class QuestKind : IEncounterKind {
public EncounterLink nextEncounter;
}
}