Ejemplo n.º 1
0
 private TesityEventDrawer.State RestoreState(SerializedProperty property)
 {
     TesityEventDrawer.State state = this.GetState(property);
     this.m_ListenersArray    = state.m_ReorderableList.serializedProperty;
     this.m_ReorderableList   = state.m_ReorderableList;
     this.m_LastSelectedIndex = state.lastSelectedIndex;
     return(state);
 }
Ejemplo n.º 2
0
 public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
 {
     this.m_Prop = property;
     this.m_Text = label.text;
     TesityEventDrawer.State state = this.RestoreState(property);
     this.OnGUI(position);
     state.lastSelectedIndex = this.m_LastSelectedIndex;
 }
Ejemplo n.º 3
0
        private TesityEventDrawer.State GetState(SerializedProperty prop)
        {
            string propertyPath = prop.propertyPath;

            TesityEventDrawer.State state;
            this.m_States.TryGetValue(propertyPath, out state);
            if (state == null)
            {
                state = new TesityEventDrawer.State();
                SerializedProperty elements = prop.FindPropertyRelative("m_PersistentCalls.m_Calls");
                state.m_ReorderableList = new ReorderableList(prop.serializedObject, elements, false, true, true, true);
                state.m_ReorderableList.drawHeaderCallback  = new ReorderableList.HeaderCallbackDelegate(this.DrawEventHeader);
                state.m_ReorderableList.drawElementCallback = new ReorderableList.ElementCallbackDelegate(this.DrawEventListener);
                state.m_ReorderableList.onSelectCallback    = new ReorderableList.SelectCallbackDelegate(this.SelectEventListener);
                state.m_ReorderableList.onReorderCallback   = new ReorderableList.ReorderCallbackDelegate(this.EndDragChild);
                state.m_ReorderableList.onAddCallback       = new ReorderableList.AddCallbackDelegate(this.AddEventListener);
                state.m_ReorderableList.onRemoveCallback    = new ReorderableList.RemoveCallbackDelegate(this.RemoveButton);
                state.m_ReorderableList.elementHeight       = 43f;
                this.m_States[propertyPath] = state;
            }
            return(state);
        }
		private TesityEventDrawer.State GetState(SerializedProperty prop)
		{
			string propertyPath = prop.propertyPath;
			TesityEventDrawer.State state;
			this.m_States.TryGetValue(propertyPath, out state);
			if (state == null)
			{
				state = new TesityEventDrawer.State();
				SerializedProperty elements = prop.FindPropertyRelative("m_PersistentCalls.m_Calls");
				state.m_ReorderableList = new ReorderableList(prop.serializedObject, elements, false, true, true, true);
				state.m_ReorderableList.drawHeaderCallback = new ReorderableList.HeaderCallbackDelegate(this.DrawEventHeader);
				state.m_ReorderableList.drawElementCallback = new ReorderableList.ElementCallbackDelegate(this.DrawEventListener);
				state.m_ReorderableList.onSelectCallback = new ReorderableList.SelectCallbackDelegate(this.SelectEventListener);
				state.m_ReorderableList.onReorderCallback = new ReorderableList.ReorderCallbackDelegate(this.EndDragChild);
				state.m_ReorderableList.onAddCallback = new ReorderableList.AddCallbackDelegate(this.AddEventListener);
				state.m_ReorderableList.onRemoveCallback = new ReorderableList.RemoveCallbackDelegate(this.RemoveButton);
				state.m_ReorderableList.elementHeight = 43f;
				this.m_States[propertyPath] = state;
			}
			return state;
		}