Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: Alex Chouls on April 20, 2012, 10:31:14 AM

Title: Get Property, Set Property, Send Message etc.
Post by: Alex Chouls on April 20, 2012, 10:31:14 AM
Remember PlayMaker gives you generic access to a lot of Unity functionality with Get Property, Set Property, Send Message, Invoke Method etc.

It's always worth checking these first to see if they do what you need.

Tutorial videos for these coming soon!

Title: Re: Get Property, Set Property, Send Message etc.
Post by: BrandonLunney on April 20, 2012, 06:21:51 PM
Excellent Alex.  I don't understand the actions entirely, but enough to make it do what I need.  It will be a glorious day when the tutorials arrive.
Title: Re: Get Property, Set Property, Send Message etc.
Post by: Lars Steenhoff on July 07, 2012, 09:15:21 PM
I need enable/disable GUIText property "Pixel Correct"  put it does not show up in the set property list, any idea how I can access this?
Title: Re: Get Property, Set Property, Send Message etc.
Post by: JieAlan on November 26, 2012, 08:44:01 PM
I love this,but can you make a doc for this ,I can't see youtube
Title: Re: Get Property, Set Property, Send Message etc.
Post by: Red on February 25, 2013, 01:37:27 PM
I would be more than curious to know what Invoke Method does too... to be honest, i hadn't seen it until now. not sure what it would do (but, that's probably becuase i don't know what a "method" really is in this context.)
Title: Re: Get Property, Set Property, Send Message etc.
Post by: Hushonik on March 02, 2013, 12:26:07 AM
waiting for a good tutorial for this.

Hush
Title: Re: Get Property, Set Property, Send Message etc.
Post by: mikejkelley on November 10, 2013, 01:51:42 PM
Quote
I need enable/disable GUIText property "Pixel Correct"  put it does not show up in the set property list, any idea how I can access this?

I have a similar problem with accessing Max Forward Speed in Character Motor (Script), it's just not there.

Quote
I love this,but can you make a doc for this ,I can't see youtube

Ditto.

Quote
i don't know what a "method" really is in this context.

Same here.

Title: Re: Get Property, Set Property, Send Message etc.
Post by: jeanfabre on November 11, 2013, 01:10:21 AM
Hi,

 This script is using some nested classes and set/get property only gives you access to the simple public variables unfortunatly.

For this you need a custom action that you can find here:

http://hutonggames.com/playmakerforum/index.php?topic=3556.msg16386#msg16386

bye,

 Jean
Title: Re: Get Property, Set Property, Send Message etc.
Post by: yodaka on February 14, 2014, 11:05:54 PM
Hello,

I have one request about get/set property. When the property is none, I want get error message!!
If property is none, the action should be error because setting to none is meaningless action. I think this behavior is very convenient to check errors. Could you consider my request?

(https://dl.dropboxusercontent.com/u/4065222/images/getproperty2.png)
Title: Re: Get Property, Set Property, Send Message etc.
Post by: yodaka on February 14, 2014, 11:57:24 PM
Hi,

The problem was solved. I insert following lines to get/set propery actions.
Code: [Select]
// ERROR Check!
if (targetProperty.PropertyName == "")
     Debug.LogError("GetProperty error!", this.Owner);

I attach my modified GetPropery action.
Title: Re: Get Property, Set Property, Send Message etc.
Post by: jeanfabre on February 17, 2014, 11:06:42 AM
Hi,

 Thanks for sharing, indeed this is always better to fire errors in these cases.

bye,

 Jean
Title: Re: Get Property, Set Property, Send Message etc.
Post by: MZK on January 04, 2015, 03:57:36 AM
Hi,

Can i request an option to set multiply Property's in one action?
Lets say i have a colider At the Object type field and i want to enabled (bool) it  and change the radius (int) at the same time (same action).

is it possible?

thanks!
MZK

Title: Re: Get Property, Set Property, Send Message etc.
Post by: Lane on January 04, 2015, 11:11:11 AM
Set property only targets one variable. You can use call method and pass multiple arguments but it doesn't sound like that's what you need.
Title: set RectTransform position value
Post by: Schiffer4 on January 12, 2015, 03:15:39 AM
Hi, i just updated the new Unity UI and encountered an annoying problem here.

I have been trying  to modify the RectTransform in order to create a flying in effect of menu but having difficulty on setting the position x through custom action, the x value is always larger than the value i set ...

The code below actually successfully modified the y and z value, just not working on the x value...

Code: [Select]
public FsmFloat rectTransFormPosX;

public bool everyFrame;

private RectTransform _rectTransform;

public override void Reset()
{
rectTransFormPosX = null;
everyFrame = false;
}

public override void OnEnter()
{

GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
if (_go!=null)
{
_rectTransform = _go.GetComponent<RectTransform>();
}

DoSetRectTransformValue();

if (!everyFrame)
Finish();
}

void DoSetRectTransformValue()
{


if (_rectTransform!=null)
{
_rectTransform.localPosition = new Vector3(rectTransFormPosX.Value, 4f, 0f);
}
}


or anyone already done this? Tried searching on ecosystem but in vain
Title: Re: Get Property, Set Property, Send Message etc.
Post by: jeanfabre on January 12, 2015, 08:08:31 AM
Hi,

 I have covered the whole api for rectTransform, you can find them on the ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181).

 have you tried using them? I think you'll have everything you need there.

 now in your case, you could be facing a simple setup issue where your RectTransform is slaved on the x axis based on layout rules you define from itself or its parent or as a result of being confised in a areay smaller than the width and so it can't move sideways.

 Bye,

 Jean
Title: Re: Get Property, Set Property, Send Message etc.
Post by: Broken Stylus on June 20, 2018, 11:30:26 AM
Hi,

I think I read somewhere on this forum that we should avoid as often as possible using the set and get property, especially if pushing to mobile. Is that still true?
They're really excellent tools.
Title: Re: Get Property, Set Property, Send Message etc.
Post by: Alex Chouls on June 20, 2018, 07:10:13 PM
Some guidelines:

- If there is a custom action that does the same thing, use that instead.
- If you are getting/setting a property once (not every frame) it's probably fine.
- If you are doing it every frame, it might still be okay, but it's more likely to affect performance.
- Test on the target device as early and often as possible.
- Profile on the target device to find the bottlenecks and fix those.
- Don't optimize prematurely - but also don't leave it to the end!

It's a balance between getting stuff done and optimizing. My personal philosophy: The biggest risk with any game is that it's not fun! Use every tool you have to figure that out first. You don't want to waste time optimizing systems you will later scrap or rework.

EDIT: We also have some ideas to optimize these actions, but that's still a little bit down the line...