playMaker

Author Topic: Moving apps to IOS Set Property and Get Property issues  (Read 7023 times)

unclebob

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Moving apps to IOS Set Property and Get Property issues
« on: May 26, 2015, 02: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



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

unclebob

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #1 on: May 26, 2015, 12:26:12 PM »
This works but is there a more efficient way?

Code: [Select]
// (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

escpodgames

  • Hero Member
  • *****
  • Posts: 686
    • View Profile
    • Assets
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #2 on: May 26, 2015, 11:04:09 PM »
Hi,

Is this something introduced in Unity5? or with IL2CPP?

unclebob

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #3 on: May 27, 2015, 01:04:47 AM »
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

marcus

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #4 on: June 10, 2015, 08:44:55 AM »
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

unclebob

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #5 on: June 11, 2015, 01:50:02 AM »
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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15403
  • Official Playmaker Support
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #6 on: June 11, 2015, 02:39:57 AM »
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

marcus

  • Playmaker Newbie
  • *
  • Posts: 2
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #7 on: June 11, 2015, 04:23:48 AM »
Thanks!

Can I use Call Method-action safely on iOS IL2CPP, or does it have the same problem?

/Marcus

MUX

  • Playmaker Newbie
  • *
  • Posts: 43
    • View Profile
    • @stefstivala
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #8 on: June 13, 2015, 09:14:56 AM »
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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15403
  • Official Playmaker Support
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #9 on: June 13, 2015, 01:28:39 PM »
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


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15403
  • Official Playmaker Support
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #10 on: June 15, 2015, 03:58:49 AM »
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

jasperPT

  • Full Member
  • ***
  • Posts: 110
  • I am a VFX Animator teaching myself to make games
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #11 on: July 09, 2015, 02:57:10 AM »
Any news on this?

Jeanfabre?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15403
  • Official Playmaker Support
    • View Profile
Re: Moving apps to IOS Set Property and Get Property issues
« Reply #12 on: July 09, 2015, 06:13:08 AM »
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