[Unity] Setting GridLength in Storyboard
Hi,
I'm trying to set the Width/Height of Row/ColumnDefinition of a Grid in a VisualState:
This works with wpf but in unity I get the following error:
Is this a bug I should report or is this by design?
Is there another way to achive this behavior?
I'm trying to set the Width/Height of Row/ColumnDefinition of a Grid in a VisualState:
Code: Select all
<VisualState x:Name="Landscape">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="col1"
Storyboard.TargetProperty="Width">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<GridLength>3*</GridLength>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="row1"
Storyboard.TargetProperty="Height">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<GridLength>*</GridLength>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
Code: Select all
[DX9] Assets/_Project/Xaml/GuiTest_2.xaml
Type 'GridLength' is not registered for boxed serialization
UnityEngine.Debug:LogError(Object)
Noesis.BuildToolKernel:OnLog(Int32, String) (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:194)
System.Object:wrapper_native_27DCA7D0()
Noesis.BuildToolKernel:Build() (at Assets/Editor/NoesisGUI/NoesisBuildToolKernel.cs:140)
NoesisPostProcessor:Build(String, Boolean, Boolean) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:363)
NoesisPostProcessor:Build(Boolean, Boolean) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:329)
NoesisPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Assets/Editor/NoesisGUI/NoesisPostProcessor.cs:256)
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[])
Is there another way to achive this behavior?
Last edited by zyzyx on 18 Sep 2014, 16:24, edited 1 time in total.
-
sfernandez
Site Admin
- Posts: 3188
- Joined:
Re: [Unity] Setting GridLength in Storyboard
It was a bug, will be fixed for the next release.
Meanwhile you will have to change Row/Column definition in code:
Meanwhile you will have to change Row/Column definition in code:
Code: Select all
ColumnDefinition col = grid.GetColumnDefinitions().Get(0).As<ColumnDefinition>();
col.SetWidth(new GridLength(3.0f, GridUnitType.Star));
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests