playMaker

Author Topic: Draw Line Action Modification Help  (Read 2703 times)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Draw Line Action Modification Help
« on: May 30, 2017, 07:29:33 AM »
Hi guys, i think it's better to post it here too, since people are rarely going into share new actions part of the forum. Anywas, since Unity 5.5, you can set the texture mode to tile or stretch on the line renderer, which i really need (actually, everyone who uses line renderer probably needs it).

I tried updating the action, but i get this error:

Assets/PlayMaker Custom Actions/Effects/DrawLine.cs(32,35): error CS0118: `UnityEngine.LineRenderer.textureMode' is a `Unresolved' but a `type' was expected

This is all i added, nothing much really:

31   [Tooltip( "Texture Mode" )]
32   public UnityEngine.LineRenderer.textureMode textureMode;

91   textureMode = UnityEngine.LineRenderer.textureMode.Stretch;
126 _lineRenderer.textureMode = textureMode;
143 _lineRenderer.textureMode = textureMode;

Any ideas, haven't seen this mistake with 'UNRESOLVED', not passing anything i shouldn't as fas as i can tell.
« Last Edit: May 30, 2017, 08:53:59 AM by krmko »
Available for Playmaker work

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Draw Line Action Modification Help
« Reply #1 on: May 30, 2017, 08:12:42 AM »
I didnt want to mess with their action. I am not sure the right approach is to put every single option all into one action? A lot of if/thens going on in that action :)

Anyways, action attached, as well as added to my github here: https://github.com/dumbgamedev/general-playmaker/tree/master/lineRenderer

Right next to my line renderer gradient action.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Draw Line Action Modification Help
« Reply #2 on: May 30, 2017, 08:20:24 AM »
Wow man, that was quick. Thanks a lot, looks like i've got a lot to learn :)
Available for Playmaker work

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Draw Line Action Modification Help
« Reply #3 on: May 30, 2017, 08:58:28 AM »
There's something i'm apparently missing. When i use your action, i need to have the Line Renderer on the object (obviously).

Edit: Ah, i see, the Line Renderer is created on Runtime as FSM draw line (). Argh, how am i gonna change that on runtime.
« Last Edit: May 30, 2017, 09:07:46 AM by krmko »
Available for Playmaker work

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Draw Line Action Modification Help
« Reply #4 on: May 30, 2017, 09:25:44 AM »
You can use the other action to create the line renderer, no? I havent played with the other action.

If not, maybe I would just make an empty object, add the line renderer component to it and make it a prefab. Then call that prefab at run time as nessesary.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Draw Line Action Modification Help
« Reply #5 on: May 30, 2017, 10:55:28 AM »
Looks like i will be doing it like that, but then i can simply check the texture mode in the inspector :) too bad, i already made the whole fsm, bah.
Available for Playmaker work

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Draw Line Action Modification Help
« Reply #6 on: May 30, 2017, 11:55:54 AM »
Lol, sometimes the easiest way is the best way  8)

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Draw Line Action Modification Help
« Reply #7 on: May 30, 2017, 02:39:59 PM »
 8)
Available for Playmaker work