using NaughtyAttributes.Editor ;
using System.Collections.Generic ;
using System.Reflection ;
using UnityEditor ;
using UnityEngine ;
{
public bool needRepaint { get = > m_pingValue > 0 ; }
float m_pingValue ;
WarnDisabledModuleAttribute m_RequiredModule ;
static MonoBehaviour m_NextToPing ;
static Dictionary < MonoBehaviour , PingableEditor > trackedEditors ;
if ( ! trackedEditors . ContainsKey ( serializedObject . targetObject as MonoBehaviour ) )
trackedEditors . Add ( serializedObject . targetObject as MonoBehaviour , this ) ;
m_RequiredModule = serializedObject . targetObject . GetType ( ) . GetCustomAttribute < WarnDisabledModuleAttribute > ( ) ;
}
protected override void OnDisable ( )
public override void OnInspectorGUI ( )
{
if ( m_RequiredModule ! = null )
{
EditorGUILayout . HelpBox ( $"This Script Requires the {m_RequiredModule.module} module : It will not execute until you enable the module in the Package Manager." , MessageType . Warning ) ;
EditorGUILayout . Space ( ) ;
}
EditorGUI . BeginDisabledGroup ( m_RequiredModule ! = null ) ;
Rect r = EditorGUILayout . BeginVertical ( ) ;
UpdatePing ( r ) ;
if ( needRepaint )
Repaint ( ) ;
EditorGUI . EndDisabledGroup ( ) ;
}
public static void PingObject ( MonoBehaviour r )