View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001182 | NoesisGUI | Unity | public | 2017-11-13 02:05 | 2019-02-24 06:44 |
| Reporter | nokola | Assigned To | sfernandez | ||
| Priority | high | Severity | crash | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 2.0.2f2 | ||||
| Target Version | 2.2.0 | Fixed in Version | 2.2.0b5 | ||
| Summary | 0001182: App crash/hang with "Target Not Found" error when trying to stop storyboard in the same frame it's already started | ||||
| Description | Noesis 2.1 beta4 | ||||
| Steps To Reproduce |
| ||||
| Attached Files | Buttons.xaml.cs (841 bytes)
#if UNITY_5_3_OR_NEWER
#define NOESIS
#endif
#if NOESIS
using Noesis;
#else
using System;
using System.Windows;
using System.Windows.Controls;
#endif
namespace Noesis.Samples
{
/// <summary>
/// Interaction logic for Buttons.xaml
/// </summary>
public partial class Buttons : UserControl
{
public Buttons()
{
this.Initialized += OnInitialized;
this.InitializeComponent();
}
#if NOESIS
private void InitializeComponent()
{
Noesis.GUI.LoadComponent(this, "Assets/NoesisGUI/Samples/Buttons/Buttons.xaml");
}
#endif
private void OnInitialized(object sender, EventArgs args)
{
this.DataContext = new ButtonsViewModel(FindName("StartButton") as Button);
}
}
} ButtonsViewModel.cs (2,567 bytes)
#if UNITY_5_3_OR_NEWER
#define NOESIS
#endif
#if NOESIS
using Noesis;
using UnityEngine;
#else
using System;
#endif
namespace Noesis.Samples
{
/// <summary>
/// Buttons sample view model
/// </summary>
public class ButtonsViewModel
{
private Button _startButton;
public ButtonsViewModel(Button startButton)
{
_startButton = startButton;
StartCommand = new DelegateCommand(this.Start);
SettingsCommand = new DelegateCommand(this.Settings);
ExitCommand = new DelegateCommand(this.Exit);
}
public DelegateCommand StartCommand { get; private set; }
public DelegateCommand SettingsCommand { get; private set; }
public DelegateCommand ExitCommand { get; private set; }
private void Start(object parameter)
{
Test.PrepareTiltReturnStoryboard(_startButton);
#if NOESIS
Debug.Log("Start Game");
#endif
}
private void Settings(object parameter)
{
#if NOESIS
Debug.Log("Change Settings");
#endif
}
private void Exit(object parameter)
{
#if NOESIS
Debug.Log("Exit Game");
#endif
}
}
public class Test
{
private static Storyboard story;
public static void PrepareTiltReturnStoryboard(Button button)
{
if (story != null)
{
story.Stop(); // all OK
story = null;
}
else
{
button.Projection = new PlaneProjection();
// setup animation
Storyboard story = new Storyboard();
story.Completed += (sender, args) => { button.Content = "done"; };
DoubleAnimation anim = new DoubleAnimation();
Storyboard.SetTargetProperty(anim, new PropertyPath("(UIElement.Projection).(PlaneProjection.RotationZ)"));
anim.To = 45;
anim.Duration = System.TimeSpan.FromSeconds(2);
story.Children.Add(anim);
Storyboard.SetTarget(anim, button);
story.Begin(button, true);
if (story.IsPlaying()) // ERROR: this code will show "Target Not Found" crash in Unity log
{
story.Stop(); // ERROR: this code will show "Target not Found" too in case the if() is removed
}
}
}
}
}
| ||||
| Platform | Any | ||||
|
We fixed the crash and improved the error messages related to Storyboard playing. In this particular scenario, though, the correct way of calling IsPlaying() is providing the same target used to start the animation, otherwise it won't be able to find the corresponding animation Clock created for playing the animation:
|
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2017-11-13 02:05 | nokola | New Issue | |
| 2017-11-13 02:05 | nokola | File Added: crashStoryboardLog.zip | |
| 2017-11-13 02:05 | nokola | File Added: Buttons.xaml.cs | |
| 2017-11-13 02:05 | nokola | File Added: ButtonsViewModel.cs | |
| 2017-11-13 02:15 | nokola | Description Updated | |
| 2017-11-13 10:37 | sfernandez | Assigned To | => sfernandez |
| 2017-11-13 10:37 | sfernandez | Status | new => assigned |
| 2018-11-01 02:14 | jsantos | View Status | public => private |
| 2018-11-22 21:21 | sfernandez | Target Version | => 2.2.0 |
| 2018-11-22 21:21 | sfernandez | View Status | private => public |
| 2018-11-22 21:21 | sfernandez | Platform | => Any |
| 2018-12-10 18:04 | sfernandez | Status | assigned => resolved |
| 2018-12-10 18:04 | sfernandez | Resolution | open => fixed |
| 2018-12-10 18:04 | sfernandez | Fixed in Version | => 2.2.0b5 |
| 2018-12-10 18:04 | sfernandez | Note Added: 0005361 | |
| 2019-02-24 06:44 | nokola | Status | resolved => closed |
| 2022-04-06 08:45 | jsantos | File Deleted: crashStoryboardLog.zip | |
| 2025-10-10 13:29 | jsantos | Category | Unity3D => Unity |