예제 #1
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     Instance = this;
     DontDestroyOnLoad(gameObject);
 }
예제 #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        FakeRunner myTarget = (FakeRunner)target;

        if (GUILayout.Button("Run Me"))
        {
            ((FakeRunner)target).RunMe();
        }

        if (GUILayout.Button("Select ALL"))
        {
            ((FakeRunner)target).SelectAll();
        }

        if (GUILayout.Button("Select NONE"))
        {
            ((FakeRunner)target).SelectNone();
        }
    }