more fixes
This commit is contained in:
@@ -109,6 +109,13 @@ namespace SplashEdit.EditorCode
|
||||
return Path.Combine(BuildOutputDir, $"scene_{sceneIndex}.splashpack");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Default license file path (SPLASHLICENSE.DAT) shipped in the package Data folder.
|
||||
/// Resolved relative to the Unity project so it works on any machine.
|
||||
/// </summary>
|
||||
public static string DefaultLicenseFilePath =>
|
||||
Path.GetFullPath(Path.Combine("Packages", "net.psxsplash.splashedit", "Data", "SPLASHLICENSE.DAT"));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the loader pack (loading screen) output path for a scene by index.
|
||||
/// Uses a deterministic naming scheme: scene_0.loading, scene_1.loading, etc.
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace SplashEdit.EditorCode
|
||||
/// </summary>
|
||||
public static string LicenseFilePath
|
||||
{
|
||||
get => EditorPrefs.GetString(Prefix + "LicenseFilePath", "");
|
||||
get => EditorPrefs.GetString(Prefix + "LicenseFilePath", SplashBuildPaths.DefaultLicenseFilePath);
|
||||
set => EditorPrefs.SetString(Prefix + "LicenseFilePath", value);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,21 +12,21 @@ namespace SplashEdit.EditorCode
|
||||
{
|
||||
private bool _interactionFoldout = true;
|
||||
private bool _advancedFoldout = false;
|
||||
|
||||
|
||||
private SerializedProperty _interactionRadius;
|
||||
private SerializedProperty _interactButton;
|
||||
private SerializedProperty _isRepeatable;
|
||||
private SerializedProperty _cooldownFrames;
|
||||
private SerializedProperty _showPrompt;
|
||||
private SerializedProperty _promptCanvasName;
|
||||
private SerializedProperty _requireLineOfSight;
|
||||
private SerializedProperty _interactionOffset;
|
||||
|
||||
private static readonly string[] ButtonNames =
|
||||
|
||||
private static readonly string[] ButtonNames =
|
||||
{
|
||||
"Select", "L3", "R3", "Start", "Up", "Right", "Down", "Left",
|
||||
"L2", "R2", "L1", "R1", "Triangle", "Circle", "Cross", "Square"
|
||||
};
|
||||
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_interactionRadius = serializedObject.FindProperty("interactionRadius");
|
||||
@@ -34,10 +34,10 @@ namespace SplashEdit.EditorCode
|
||||
_isRepeatable = serializedObject.FindProperty("isRepeatable");
|
||||
_cooldownFrames = serializedObject.FindProperty("cooldownFrames");
|
||||
_showPrompt = serializedObject.FindProperty("showPrompt");
|
||||
_promptCanvasName = serializedObject.FindProperty("promptCanvasName");
|
||||
_requireLineOfSight = serializedObject.FindProperty("requireLineOfSight");
|
||||
_interactionOffset = serializedObject.FindProperty("interactionOffset");
|
||||
}
|
||||
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
@@ -76,15 +76,35 @@ namespace SplashEdit.EditorCode
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
EditorGUILayout.PropertyField(_showPrompt);
|
||||
EditorGUILayout.Space(4);
|
||||
|
||||
EditorGUILayout.PropertyField(_showPrompt, new GUIContent("Show Prompt Canvas"));
|
||||
|
||||
if (_showPrompt.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_promptCanvasName, new GUIContent("Canvas Name"));
|
||||
if (string.IsNullOrEmpty(_promptCanvasName.stringValue))
|
||||
{
|
||||
EditorGUILayout.HelpBox(
|
||||
"Enter the name of a PSXCanvas that will be shown when the player is in range and hidden when they leave.",
|
||||
MessageType.Info);
|
||||
}
|
||||
if (_promptCanvasName.stringValue != null && _promptCanvasName.stringValue.Length > 15)
|
||||
{
|
||||
EditorGUILayout.HelpBox("Canvas name is limited to 15 characters.", MessageType.Warning);
|
||||
}
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
});
|
||||
|
||||
EditorGUILayout.Space(2);
|
||||
|
||||
_advancedFoldout = PSXEditorStyles.DrawFoldoutCard("Advanced", _advancedFoldout, () =>
|
||||
{
|
||||
EditorGUILayout.PropertyField(_requireLineOfSight);
|
||||
EditorGUILayout.PropertyField(_interactionOffset);
|
||||
EditorGUILayout.PropertyField(_requireLineOfSight,
|
||||
new GUIContent("Require Facing",
|
||||
"Player must be facing the object to interact. Uses a forward-direction check."));
|
||||
});
|
||||
|
||||
EditorGUILayout.Space(4);
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
// I raged that my scrollwheel was broken while writing this and that's why it's 2 files.
|
||||
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using SplashEdit.RuntimeCode;
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace SplashEdit.EditorCode
|
||||
if (collType == PSXCollisionType.Static)
|
||||
{
|
||||
EditorGUILayout.LabelField(
|
||||
"<color=#88cc88>Baked into world collision mesh. No runtime cost.</color>",
|
||||
"<color=#88cc88>Only bakes holes in the navregions</color>",
|
||||
PSXEditorStyles.RichLabel);
|
||||
}
|
||||
else if (collType == PSXCollisionType.Dynamic)
|
||||
|
||||
Reference in New Issue
Block a user