void DestroyEditorsIfNeeded() { if (m_TwitchChatEditor != null) { DestroyImmediate(m_TwitchChatEditor); m_TwitchChatEditor = null; } if (m_TwitchConnectEditor != null) { DestroyImmediate(m_TwitchConnectEditor); m_TwitchConnectEditor = null; } }
void CreateEditorsIfNeeded() { m_TwitchChat = m_UniTwitchIRCBehaviours.GetComponentInChildren <TwitchChat>(); if (m_TwitchChat) { if (m_TwitchChatEditor == null) { m_TwitchChatEditor = Editor.CreateEditor(m_TwitchChat, typeof(TwitchChatEditor)) as TwitchChatEditor; } m_ChannelProperty = m_TwitchChatEditor.serializedObject.FindProperty("m_Channel"); m_OpenOnRunProperty = serializedObject.FindProperty("m_OpenOnRun"); } m_TwitchConnect = m_UniTwitchIRCBehaviours.GetComponentInChildren <TwitchConnect>(); if (m_TwitchConnect) { if (m_TwitchConnectEditor == null) { m_TwitchConnectEditor = Editor.CreateEditor(m_TwitchConnect) as TwitchConnectEditor; } } }