Skip to content
Snippets Groups Projects
Commit c4344d1a authored by Heine, Eric R's avatar Heine, Eric R
Browse files

Test to see if I can get the context menus to create the scriptable objects to...

Test to see if I can get the context menus to create the scriptable objects to work with Unity's Package Manager before I put in all the work to redo all this stuff.
parent 4ab67ad7
No related branches found
No related tags found
No related merge requests found
Showing
with 85 additions and 0 deletions
fileFormatVersion: 2
guid: 086cb5bd426a325489d1b1c6a404db34
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine;
using UnityEditor;
using System.IO;
using System.Collections;
namespace Shared.ScriptableVariables {
public static class GameEventMenu {
[MenuItem("Assets/Create/Scriptable Objects/Events/Game Event", false, 0)]
public static void CreateTextMeshProObjectPerform() {
string filePath;
if (Selection.assetGUIDs.Length == 0) {
// No asset selected.
filePath = "Assets";
}
else {
// Get the path of the selected folder or asset.
filePath = AssetDatabase.GUIDToAssetPath(Selection.assetGUIDs[0]);
// Get the file extension of the selected asset as it might need to be removed.
string fileExtension = Path.GetExtension(filePath);
if (fileExtension != "") {
filePath = Path.GetDirectoryName(filePath);
}
}
string filePathWithName = AssetDatabase.GenerateUniqueAssetPath(filePath + "/New Game Event.asset");
//// Create new Game Event Asset.
var gameEvent = ScriptableObject.CreateInstance<GameEvent>();
AssetDatabase.CreateAsset(gameEvent, filePathWithName);
EditorUtility.SetDirty(gameEvent);
AssetDatabase.SaveAssets();
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 78b2a79d509699c4bb8bfc4f1e87bd13
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
{
"name": "Scriptable Variables Editor Assembly",
"references": [
"Scriptable Variables Assembly"
],
"optionalUnityReferences": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": []
}
\ No newline at end of file
fileFormatVersion: 2
guid: 7813aee3fdf805348828ee9933b3e82f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 753783a659666304fbc9982cd49a729e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment