Я пытаюсь добавить слушателей в сцену в проекте Ross XPression. Я использую секвенсор в XPression Developer. Когда я нажимаю кнопку «+» на моей клавиатуре, выбирая сцену в секвенсере, я ожидаю, что что-то будет записано на консоль.
Вот вывод из консоли:XPression События не срабатывают
scene.Name == Opener
scene.AnimControllerCount == 2
animController.Name == AnimController1
animController.Name == Rotate
И вот мой код:
private xpEngine engine;
private xpProject project;
private xpScene scene;
private xpAnimController animController1;
private xpAnimController animController2;
public MainWindow()
{
InitializeComponent();
engine = new xpEngine();
project = engine.ActiveProject;
if (project.GetSceneByName("Opener",out scene))
{
Console.WriteLine("scene.Name == " + scene.Name);
scene.OnSceneState += Scene_OnSceneState;
scene.SceneDirector.OnSceneDirectorState += SceneDirector_OnSceneDirectorState;
Console.WriteLine("scene.AnimControllerCount == " + scene.AnimControllerCount);
if (scene.GetAnimController(0, out animController1))
{
Console.WriteLine("animController.Name == " + animController1.Name);
animController1.OnStateChange += AnimController_OnStateChange;
}
if (scene.GetAnimController(1, out animController2))
{
Console.WriteLine("animController.Name == " + animController2.Name);
animController2.OnStateChange += AnimController_OnStateChange;
}
}
}
private void SceneDirector_OnSceneDirectorState(xpSceneDirector Director, SceneDirectorState State)
{
Console.WriteLine("Director: " + Director.Name + " State: " + State);
}
private void Scene_OnSceneState(xpScene Scene, int State)
{
Console.WriteLine("Scene: " + Scene.Name + " State: " + State);
}
private void AnimController_OnStateChange(xpAnimController Controller, PlayState State)
{
Console.WriteLine("Controller: " + Controller.Name + " State: " + State);
}
Сам секвенсор делает копию сцены, так что я не могу понять способ сделать это. Как видно из вывода, события не запускаются. Почему это? Буду признателен за любую помощь.