Esempio n. 1
0
    public override void OnInspectorGUI()
    {
        EMOpenCloseMotion t = (EMOpenCloseMotion)target;

        EditorGUILayout.Space();
        t.motionName = EditorGUILayout.TextField("Motion name", t.motionName);

        EditorGUILayout.Space();
        t.OpenAtStart = EMGuiTools.Toggle("Open at start", t.OpenAtStart, true);

        EditorGUILayout.Space();
        t.alpha = EditorGUILayout.Slider("Alpha", t.alpha, 0f, 1f);

        EditorGUILayout.Space();

        // open effect
        t.showOpenInspector = EMGuiTools.BeginFoldOut("Open motion", t.showOpenInspector);
        if (t.showOpenInspector)
        {
            EMGuiTools.BeginGroup(); {
                UIEffectInspector(t.openProp, t.rectTransform(), ref inRecOpen);
            } EMGuiTools.EndGroup();
        }

        // Close Effect
        t.showCloseInspector = EMGuiTools.BeginFoldOut("Close motion", t.showCloseInspector);
        if (t.showCloseInspector)
        {
            EMGuiTools.BeginGroup(); {
                UIEffectInspector(t.closeProp, t.rectTransform(), ref inRecClose);
            } EMGuiTools.EndGroup();
        }

        // Events
        t.showEventInspector = EMGuiTools.BeginFoldOut("Events", t.showEventInspector);
        if (t.showEventInspector)
        {
            EMGuiTools.BeginGroup(); {
                serializedObject.Update();
                SerializedProperty openStart = serializedObject.FindProperty("onOpenStart");
                EditorGUILayout.PropertyField(openStart, true, null);
                serializedObject.ApplyModifiedProperties();

                serializedObject.Update();
                SerializedProperty openEnd = serializedObject.FindProperty("onOpenEnd");
                EditorGUILayout.PropertyField(openEnd, true, null);
                serializedObject.ApplyModifiedProperties();

                serializedObject.Update();
                SerializedProperty closeStart = serializedObject.FindProperty("onCloseStart");
                EditorGUILayout.PropertyField(closeStart, true, null);
                serializedObject.ApplyModifiedProperties();

                serializedObject.Update();
                SerializedProperty closeend = serializedObject.FindProperty("onCloseEnd");
                EditorGUILayout.PropertyField(closeend, true, null);
                serializedObject.ApplyModifiedProperties();
            } EMGuiTools.EndGroup();
        }
    }
Esempio n. 2
0
    void OnDisable()
    {
        EMOpenCloseMotion t = (EMOpenCloseMotion)target;

        if (inRecOpen)
        {
            EndRecord(t.openProp, t.rectTransform());
        }

        if (inRecClose)
        {
            EndRecord(t.closeProp, t.rectTransform());
        }
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     motion = GetComponent <EMOpenCloseMotion>();
 }
Esempio n. 4
0
	// Use this for initialization
	void Start () 
	{
		motion = GetComponent<EMOpenCloseMotion>();
	}
Esempio n. 5
0
 void Start()
 {
     panel = GetComponent <EMOpenCloseMotion>();
 }