update CCK to 3.10, fixing unity 2021 crash :)
This commit is contained in:
parent
48a978fa2a
commit
d11e0fb3a9
492 changed files with 2165204 additions and 437687 deletions
25
Assets/ABI.CCK/Scripts/Editor/ScriptedImporter/LuaScriptImporter.cs
Executable file
25
Assets/ABI.CCK/Scripts/Editor/ScriptedImporter/LuaScriptImporter.cs
Executable file
|
@ -0,0 +1,25 @@
|
|||
using System.IO;
|
||||
using ABI.CCK.Components;
|
||||
using ABI.CCK.Components.ScriptableObjects;
|
||||
using UnityEditor.AssetImporters;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ABI.CCK.Scripts.Editor.ScriptedImporter
|
||||
{
|
||||
[ScriptedImporter(1, "lua")]
|
||||
public class LuaScriptImporter : UnityEditor.AssetImporters.ScriptedImporter
|
||||
{
|
||||
public override void OnImportAsset(AssetImportContext ctx)
|
||||
{
|
||||
CVRLuaScript asset = ScriptableObject.CreateInstance<CVRLuaScript>();
|
||||
asset.name = Path.GetFileNameWithoutExtension(ctx.assetPath);
|
||||
asset.m_ScriptPath = ctx.assetPath;
|
||||
asset.m_ScriptText = File.ReadAllText(ctx.assetPath);
|
||||
|
||||
ctx.AddObjectToAsset(CVRLuaScript.kLuaScriptIdentifier, asset, CVRLuaScript.s_LuaScriptIcon);
|
||||
ctx.SetMainObject(asset);
|
||||
|
||||
//Debug.Log("Imported Lua script: " + ctx.assetPath, asset);
|
||||
}
|
||||
}
|
||||
}
|
3
Assets/ABI.CCK/Scripts/Editor/ScriptedImporter/LuaScriptImporter.cs.meta
Executable file
3
Assets/ABI.CCK/Scripts/Editor/ScriptedImporter/LuaScriptImporter.cs.meta
Executable file
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bb386971c8c3435489e51683f3fd9aa9
|
||||
timeCreated: 1713054941
|
29
Assets/ABI.CCK/Scripts/Editor/ScriptedImporter/LuaScriptImporterGUI.cs
Executable file
29
Assets/ABI.CCK/Scripts/Editor/ScriptedImporter/LuaScriptImporterGUI.cs
Executable file
|
@ -0,0 +1,29 @@
|
|||
using ABI.CCK.Components.ScriptableObjects;
|
||||
using UnityEditor;
|
||||
using UnityEditor.AssetImporters;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ABI.CCK.Scripts.Editor.ScriptedImporter
|
||||
{
|
||||
[CustomEditor(typeof(LuaScriptImporter))]
|
||||
public class LuaScriptImporterGUI: ScriptedImporterEditor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
base.ApplyRevertGUI();
|
||||
|
||||
CVRLuaScript asset = assetTarget as CVRLuaScript;
|
||||
if (asset is null)
|
||||
return;
|
||||
|
||||
// helpbox explaining lua
|
||||
EditorGUILayout.HelpBox(
|
||||
"Lua is a language supported by ChilloutVR that you can use to easily add scripted behaviours to objects in props, avatars, and worlds.",
|
||||
MessageType.Info);
|
||||
|
||||
// display button for documentation
|
||||
if (GUILayout.Button("Open Documentation"))
|
||||
Application.OpenURL("example.com");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f5fae4c6aefb4cb4a4762fcebe836720
|
||||
timeCreated: 1713054941
|
Loading…
Add table
Add a link
Reference in a new issue