Example #1
0
        // PRIVATE STATIC

        //--------------------------------------
        //  Events
        //--------------------------------------
        /// <summary>
        /// _ons the button click.
        /// </summary>
        /// <param name='buttonClickType'>
        /// Button click type.
        /// </param>
        private void _onButtonClick(ButtonClickType buttonClickType)
        {
            IEnumerator iEnumerator = _managersFromRAM_serializedproperty.GetEnumerator();

            while (iEnumerator.MoveNext())
            {
                Debug.Log("is : " + (iEnumerator.Current as SerializedProperty).objectReferenceValue);
            }

            switch (buttonClickType)
            {
            case ButtonClickType.ADD:
                _managersFromRAM_serializedproperty.InsertArrayElementAtIndex(0);
                _managersFromRAM_serializedproperty.GetArrayElementAtIndex(0).objectReferenceValue = _inUseFromAssets_scriptableobject;
                break;

            case ButtonClickType.REMOVE:

                //
                if (_hasManagerAlready(_monoScript.GetClass()))
                {
                    Debug.Log("i: " + _getManagerIndex(_monoScript.GetClass()));
                    _managersFromRAM_serializedproperty.DeleteArrayElementAtIndex(0);
                }

                break;

            case ButtonClickType.CONVERT:


                ScriptableObject scriptableObject = ScriptableObjectUtility.CreateAssetFromMonoScript(_monoScript);
                EditorWindowUtility.doSetThenUnsetProjectWindowSelectionTo(scriptableObject);
                break;
            }

            _managersFromRAM_serializedproperty.serializedObject.ApplyModifiedProperties();
            _managersFromRAM_serializedproperty.serializedObject.SetIsDifferentCacheDirty();
            _managersFromRAM_serializedproperty.serializedObject.UpdateIfDirtyOrScript();
        }