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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue