public override void OnInspectorGUI()
        {
            MonoImporter target = this.target as MonoImporter;
            MonoScript   script = target.GetScript();

            if (!(bool)((UnityEngine.Object)script))
            {
                return;
            }
            System.Type type = script.GetClass();
            if (!MonoScriptImporterInspector.IsTypeCompatible(type))
            {
                EditorGUILayout.HelpBox("No MonoBehaviour scripts in the file, or their names do not match the file name.", MessageType.Info);
            }
            XMonoBehaviourEditor.ShowXAttributeType(type);
            Vector2 iconSize = EditorGUIUtility.GetIconSize();

            EditorGUIUtility.SetIconSize(new Vector2(16f, 16f));
            List <string>             names   = new List <string>();
            List <UnityEngine.Object> objects = new List <UnityEngine.Object>();
            bool didModify = false;

            this.ShowFieldInfo(type, target, names, objects, ref didModify);
            EditorGUIUtility.SetIconSize(iconSize);
            if (!didModify)
            {
                return;
            }
            target.SetDefaultReferences(names.ToArray(), objects.ToArray());
            AssetDatabase.ImportAsset(AssetDatabase.GetAssetPath((UnityEngine.Object)target));
        }
Пример #2
0
        public override void OnInspectorGUI()
        {
            XBaseEditor.DrawLogo();
            base.OnInspectorGUI();
            XMonoBehaviourEditor.ShowXAttributeMember(target);

            var networkBehaviour = target as NetworkBehaviour;

            XBaseWindow.CreateCheckBox("isServer", networkBehaviour.isServer);
            XBaseWindow.CreateCheckBox("isClient", networkBehaviour.isClient);
            XBaseWindow.CreateCheckBox("isLocalPlayer", networkBehaviour.isLocalPlayer);
            XBaseWindow.CreateIntField("netId", (int)networkBehaviour.netId.Value);
            XBaseWindow.CreateIntField("playerControllerId", (int)networkBehaviour.playerControllerId);
        }
Пример #3
0
 public override void OnInspectorGUI()
 {
     XBaseEditor.DrawLogo();
     base.OnInspectorGUI();
     XMonoBehaviourEditor.ShowXAttributeMember(target);
 }