Alright, I wanna make my custom script in the Editor, but I'm not sure how to finish it, Check out the script there's 1 thing that isnt working properly, and the other i dont know how to do.
The thing that doesnt work im guessing it must be an unity bug, the shortcut doesn't work (im on windows) if i do crtl+c but it works if i do the same with my capslock on, (even thou its a small letter), so if someone can explain why this is... also, the other thing i dont know, is how to select the item i have just created in the Hirearchy, thanks.
using UnityEditor;
using UnityEngine;
class ResetObject : MonoBehaviour {
// Add menu named "Do Something" to the main menu
// and give it a shortcut (ctrl-o on Windows, cmd-o on OS X).
[MenuItem("kici/New GameObject %c")]
static void NewObject()
{
new GameObject("kici");
// Debug.Log("Perform operation");
}
}
how does the shortcut look like a bug ? whats the propery way, i even tried only wiht "k" and "K" they both work (only if caps lock is on..?
– anon45860336I meant a bug with unity. Have you tried out any of the other shortcut options? I'm sure you've seen this page: http://unity3d.com/support/documentation/ScriptReference/MenuItem.html I can't see why yours isn't working.
– anon79923769yes i have... well that sux i dont have time to report another bug again, since they didnt even reply to my last one :S (RPC's didnt sent to the client LOL);;; thx i'll give u the answer!
– anon45860336This is the error i get: Error 1 Cannot implicitly convert type 'UnityEngine.GameObject' to 'UnityEngine.Object[]' on this line: Selection.objects = newObject;
– anon45860336Well, I usually use unityscript, so I'm not sure how to resolve that error - so I changed the code a bit instead. Assigning the new gameObject to Selection.activeGameObject works just fine since you're only assigning one object anyway.
– anon79923769