I’m trying to create a test-mode for my scenes, so I want
to insert a few things into the scene automatically just
after activating play mode. The first thing I need to do
is to be able to respond to playmode state changes. This
is my first attempt.
import UnityEngine
import UnityEditor
[InitializeOnLoad]
class Tester (object):
static def constructor():
EditorApplication.playmodeStateChanged = System.Delegate.Combine(
PlayStateChanged,
EditorApplication.playmodeStateChanged)
static def PlayStateChanged():
Debug.Log("playmodeStateChanged")
And the result:
System.ArgumentException: Incompatible Delegate Types.
at System.Delegate.Combine (System.Delegate a, System.Delegate b) [0x00000] in <filename unknown>:0
at Tester..cctor () [0x00000] in C:\Documents and Settings\Mayke\...\Tester.boo:8
UnityEngine.SetupCoroutine:InvokeStatic(Type, String, Object)
I found some information at: