Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: drown on September 06, 2017, 11:39:36 AM

Title: uGui Drop Down Add Option Problem (Video) [SOLVED]
Post by: drown on September 06, 2017, 11:39:36 AM
Unity Version : Unity 2017.1.0f3 (Personal)
Playmaker version : 1.8.5

I am trying to let the user enter a new option for a drop down field. He enters his option via Inputfield, the submitted value is then passed through a Regex action, removing all letters from the number, then a string is built using the same format as my dropdown actions. After this, the string is added to the dropdown field via "uGui Add Drop Down Option" action.

Once the "Add Option" action is active, I get this error :

Code: [Select]
InvalidCastException: Cannot cast from source type to destination type.
HutongGames.PlayMaker.Actions.uGuiDropDownAddOptions.DoAddOptions () (at Assets/PlayMaker Custom Actions/uGui/uGuiDropDownAddOptions.cs:71)
HutongGames.PlayMaker.Actions.uGuiDropDownAddOptions.OnEnter () (at Assets/PlayMaker Custom Actions/uGui/uGuiDropDownAddOptions.cs:48)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:199)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2670)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2628)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2556)
HutongGames.PlayMaker.Fsm.DoTransition (HutongGames.PlayMaker.FsmTransition transition, Boolean isGlobal) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2595)
HutongGames.PlayMaker.Fsm.ProcessEvent (HutongGames.PlayMaker.FsmEvent fsmEvent, HutongGames.PlayMaker.FsmEventData eventData) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2198)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2289)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEvent fsmEvent) (at c:/Users/User/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2370)
HutongGames.PlayMaker.Actions.uGuiInputFieldOnSubmitEvent.DoOnEndEdit (System.String value) (at Assets/PlayMaker Custom Actions/uGui/uGuiInputFieldOnSubmitEvent.cs:69)
UnityEngine.Events.InvokableCall`1[System.String].Invoke (System.Object[] args) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:189)
UnityEngine.Events.InvokableCallList.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:637)
UnityEngine.Events.UnityEventBase.Invoke (System.Object[] parameters) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent.cs:773)
UnityEngine.Events.UnityEvent`1[T0].Invoke (.T0 arg0) (at C:/buildslave/unity/build/Runtime/Export/UnityEvent_1.cs:53)
UnityEngine.UI.InputField.SendOnSubmit () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:1582)
UnityEngine.UI.InputField.DeactivateInputField () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:2303)
UnityEngine.UI.InputField.OnUpdateSelected (UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/InputField.cs:1254)
UnityEngine.EventSystems.ExecuteEvents.Execute (IUpdateSelectedHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:99)
UnityEngine.EventSystems.ExecuteEvents.Execute[IUpdateSelectedHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:261)
UnityEngine.EventSystems.EventSystem:Update()

The variable type is correct in the action, it doesnt work even if I enter a random text in the action itself. I might have set up the uGui proxies wrong, but since every other uGui action works I have no clue what I should change. I made a short video to demonstrate this error in a different project (nearly no third party assets, just some transitions) :

https://www.youtube.com/watch?v=jGqJk8GonVQ (https://www.youtube.com/watch?v=jGqJk8GonVQ)

Thanks in advance
Alex
Title: Re: uGui Drop Down Add Option Problem (Video)
Post by: jeanfabre on September 07, 2017, 05:18:22 AM
Hi,
 
 let me have a look at this. Please bump me on Monday if I haven't replied. Thanks :)

 Bye,

 Jean
Title: Re: uGui Drop Down Add Option Problem (Video)
Post by: drown on September 11, 2017, 05:35:29 AM
Bump, hopefully this can be solved.
Title: Re: uGui Drop Down Add Option Problem (Video)
Post by: jeanfabre on September 12, 2017, 01:59:09 AM
Hi,

 Thanks for the bump, I need this. I am on it right now.

 Bye,

 Jean
Title: Re: uGui Drop Down Add Option Problem (Video)
Post by: jeanfabre on September 12, 2017, 02:55:50 AM
Hi,

 ok, done, please re download the uGui package from the Ecosystem. the action is fixed.

 Bye,

 Jean
Title: Re: uGui Drop Down Add Option Problem (Video) [SOLVED]
Post by: drown on September 12, 2017, 07:14:20 AM
I can confirm that it is fixed ! Thank you for the amazing support & efforts !  :) 8)