Playmaker Forum
PlayMaker Help & Tips => iOS Help => Topic started by: unclebob on May 26, 2015, 05:37:09 AM
-
Hi
building out one of apps to ios, in Unity 5 and Playmaker.
Everything works bar the functionality of Set Property and Get Property. We are working through the Link errors and Splashscreen errors as I type....possibly a familiar exercise for many...tips gratefully received.
Would normally work out how to fix the Set and Get Property issues ourselves but deadlines are really upon us, we only just found out that these actions simply don't work with ios builds and given the time to build, fix and test we are up against it.
Reading through the forum the preferred approach is to write specific actions. We could really do with a leg up here if anyone could offer some help.
We use Set Object multiple times, such as here
(http://i.imgur.com/ROeQTVc.jpg)
An example of how these could be written as custom actions would allow us to work through all the other instances.
Thank you in advance.
Cheers
UB
-
This works but is there a more efficient way?
// (c) Copyright HutongGames, LLC 2010-2013. All rights reserved.
using UnityEngine;
using UnityEngine.UI;
using System;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.String)]
[Tooltip("Sets the value of a TextMesh Variable.")]
public class SetTextMeshValue : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmOwnerDefault gameObject;
public FsmString StringtoChange;
public bool everyFrame;
public override void Reset()
{
gameObject = null;
StringtoChange = null;
everyFrame = false;
}
public override void OnEnter()
{
DoSetStringValue();
if (!everyFrame)
Finish();
}
public override void OnUpdate()
{
DoSetStringValue();
}
void DoSetStringValue()
{
if (StringtoChange == null) return;
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
go.GetComponent<TextMesh>().text = StringtoChange.Value;
}
}
}
Cheers
UB
-
Hi,
Is this something introduced in Unity5? or with IL2CPP?
-
Just didn't work so looked it up here and found this
Hi,
You should not use SetProperty when targeting iPhone, some work some doesn't, I never could make sense of the rule for this. I removed all SetProperties and built custom actions for each one of them, and all problems where gone from that front, that was before IL2CPP, but I we stick to this.
Bye,
Jean
Hope this helps
Cheers
UB
-
Hi!
How about Get Property? I started to use IL2CPP (Unity 4.6.6 and iOS) today since iTunes Connect requires 64bit apps. I use Get Property all over.
Q1: Is Get Property broken too?
Background: My game has worked fine with Unity and iOS and Get Property. When moving to IL2CPP today it stopped working.
Q2: What should I use instead? Call Method - will it work on iOS IL2CPP?
It would be very impractical for me to write custom Playmaker actions for each and every property (60 maybe).
Thanks
Marcus
-
Hi mate
sorry to say we had to replace all the get properties as well.
We basically set up one template, went with exposed variables (great for on the fly debugging and polishing) and copied the relevant code in. Don't forget to restart Unity to get the scripts to compile.
Its surprising how quick it can be done and don't forget there are a ton of shared custom actions which already have the functionality you need or can change.
The only small issue with that is then sharing those actions across multiple projects. We end up creating a new empty project, exiting and then cut and pasting a "blank" starter project into its place.
I suspect there will be a few more hoops like this with Apple as things are changing over the next few months re swift, xcode and metal with updates 8.4 and on to ios 9.
Best to allow for some extra time for all these changes as whatever 3rd party tools you use there will be catchup time before their functionality is available.
Fingers crossed though the whole development workflow will improve and there will be less building something to find one flag has been set wrong when uploading to itunes connect.
Damn frustrating that.
Good luck mate.
Unclebob
-
Hi,
Well, as I currently investigate this matter, it turns out that it's very likely doable by referencing the classes you are accessing using reflections ( get set properties action are using reflections).
http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html
I am building a testing project to validate this and make sure for a given set/get property that fails, doing a proper link.xml description resolves the issue.
Bye,
Jean
-
Thanks!
Can I use Call Method-action safely on iOS IL2CPP, or does it have the same problem?
/Marcus
-
Hi,
Well, as I currently investigate this matter, it turns out that it's very likely doable by referencing the classes you are accessing using reflections ( get set properties action are using reflections).
http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html
I am building a testing project to validate this and make sure for a given set/get property that fails, doing a proper link.xml description resolves the issue.
Bye,
Jean
Hi Jean, kinda stuck right about here too when upgrading my project to ILCPP. can you elaborate on how i could edit the link.xml please?
-
Hi,
can you elaborate on what problems you are encountering exactly?
the current findings are as follow:
if you switch to the PlayMake nacl, I can publish succesfully to the device with all stripping levels options.
the above is regardless of the use of Get/set Property action.
for example, setting the background color of the camera using SEt Property works, but setting the text of aTextMesh doesn't work! it fires no errors, xcode debugger doesn't catch anything... so I am currently investigating precisly this case and maybe link.xml will be required but I am not sure yet why, since it's part of Unity.
Bye,
Jean
-
Thanks!
Can I use Call Method-action safely on iOS IL2CPP, or does it have the same problem?
/Marcus
I am currently investigating on all of this, I'll have more infos soon.
Bye,
Jean
-
Any news on this?
Jeanfabre?
-
Hi,
Yep, I made a post on this thread:
http://hutonggames.com/playmakerforum/index.php?topic=9443.msg50405#msg50405
sorry I forgot to also mention it on this thread...
more to come on this as I am working now on letting this wizard also create the link.xml file automatically, right now you'll have to do this manually, but at least, you'll know what to include.
Bye,
Jean