//--------------------------------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------------------------------- public CSEventWrapper(CSEventWrapper copyFrom) { //We don't need to copy m_csEvent since it will be loaded in the script using //m_serializedData as the source m_type = copyFrom.m_type; m_serializedData = copyFrom.m_serializedData; }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { //TODO: move this to somewhere called less frequently CSEventWrapper eventWrapper = EditorHelper.GetObjectFromSerializedProperty(property) as CSEventWrapper; //Don't draw anything if the object doesn't exist if (eventWrapper == null) { return; } eventWrapper.Load(); if (GUI.Button(position, eventWrapper.ToString())) { CSEventWrapperWindow window = EditorWindow.GetWindow(typeof(CSEventWrapperWindow)) as CSEventWrapperWindow; //Set the window object reference window.eventWrapper = eventWrapper; window.serializedObject = property.serializedObject; window.Show(); } }
//--------------------------------------------------------------------------------------------- // Constructor //--------------------------------------------------------------------------------------------- public CSEffect(CSEffect copyFrom) { m_event = new CSEventWrapper(copyFrom.m_event); m_action = new CSActionWrapper(copyFrom.m_action); }