playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - cwmanley

Pages: [1] 2
1
Share New Actions / MCS 1.6+ Actions
« on: April 14, 2017, 08:15:48 PM »
Hi,

27 Actions for MCS 1.6+

Thanks

2
Share New Actions / Some ConfigurableJoint Actions
« on: September 19, 2016, 09:48:31 PM »
Hi,

SetConfigurableJointLimits
SetConfigurableJointDrives

On the Ecosystem or https://snipt.net/cwmanley/

//TODO

Thanks

Code: [Select]
// License: Attribution 4.0 International (CC BY 4.0)
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// Keywords: ConfigurableJoint, Joint

using System;
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Physics)]
[Tooltip("Sets the Drives on a Configurable Joint Component")]
public class SetConfigurableJointDrives : FsmStateAction
{
[RequiredField]
[Tooltip("The Game Object with the ConfigurableJoint component")]
[CheckForComponent(typeof(ConfigurableJoint))]
public FsmOwnerDefault gameObject;

[Tooltip("How the joint's movement will behave along its local axis.")]
public Drives driveType;

[Tooltip("Strength of a rubber-band pull toward the defined direction. Only used if mode includes Position.")]
public FsmFloat positionSpring;

[Tooltip("Resistance strength against the Position Spring. Only used if mode includes Position.")]
public FsmFloat positionDamper ;

[Tooltip("Amount of force applied to push the object toward the defined direction.")]
public FsmFloat maximumForce;

public bool everyFrame;

public enum Drives{
DriveX,
DriveY,
DriveZ,
DriveAngluarX,
DriveAngluarYZ,
DriveSlerp
}

public override void Reset()
{
gameObject = null;
driveType = Drives.DriveX;
maximumForce = 3.402823e+38f;
positionDamper = 0f;
positionSpring = 0f;
everyFrame = false;

}

public override void OnEnter()
{
DoAction();

if (!everyFrame)
{Finish();
}
}

public override void OnUpdate(){
DoAction();
}

void DoAction(){

GameObject go = Fsm.GetOwnerDefaultTarget (gameObject);

if (go == null) {
return;
}

ConfigurableJoint cj = go.GetComponent<ConfigurableJoint> ();

if (cj == null) {
return;
}


JointDrive jd = new JointDrive ();

jd.maximumForce = maximumForce.Value;
jd.positionDamper = positionDamper.Value;
jd.positionSpring = positionSpring.Value;


//
switch (driveType)
{
case Drives.DriveX:
{
cj.xDrive = jd;
}
break;
case Drives.DriveAngluarX:
{
cj.angularXDrive = jd;
}
break;
case Drives.DriveAngluarYZ:
{
cj.angularYZDrive = jd;
}
break;
case Drives.DriveZ:
{
cj.zDrive = jd;
}
break;
case Drives.DriveY:
{
cj.yDrive = jd;
}
break;
case Drives.DriveSlerp:
{
cj.slerpDrive = jd;
}
break;
}
//

}
}
}


Code: [Select]
// License: Attribution 4.0 International (CC BY 4.0)
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// Keywords: ConfigurableJoint, Joint

using System;
using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Physics)]
[Tooltip("Sets the Drives on a Configurable Joint Component")]
public class SetConfigurableJointDrives : FsmStateAction
{
[RequiredField]
[Tooltip("The Game Object with the ConfigurableJoint component")]
[CheckForComponent(typeof(ConfigurableJoint))]
public FsmOwnerDefault gameObject;

[Tooltip("How the joint's movement will behave along its local axis.")]
public Drives driveType;

[Tooltip("Strength of a rubber-band pull toward the defined direction. Only used if mode includes Position.")]
public FsmFloat positionSpring;

[Tooltip("Resistance strength against the Position Spring. Only used if mode includes Position.")]
public FsmFloat positionDamper ;

[Tooltip("Amount of force applied to push the object toward the defined direction.")]
public FsmFloat maximumForce;

public bool everyFrame;

public enum Drives{
DriveX,
DriveY,
DriveZ,
DriveAngluarX,
DriveAngluarYZ,
DriveSlerp
}

public override void Reset()
{
gameObject = null;
driveType = Drives.DriveX;
maximumForce = 3.402823e+38f;
positionDamper = 0f;
positionSpring = 0f;
everyFrame = false;

}

public override void OnEnter()
{
DoAction();

if (!everyFrame)
{Finish();
}
}

public override void OnUpdate(){
DoAction();
}

void DoAction(){

GameObject go = Fsm.GetOwnerDefaultTarget (gameObject);

if (go == null) {
return;
}

ConfigurableJoint cj = go.GetComponent<ConfigurableJoint> ();

if (cj == null) {
return;
}


JointDrive jd = new JointDrive ();

jd.maximumForce = maximumForce.Value;
jd.positionDamper = positionDamper.Value;
jd.positionSpring = positionSpring.Value;


//
switch (driveType)
{
case Drives.DriveX:
{
cj.xDrive = jd;
}
break;
case Drives.DriveAngluarX:
{
cj.angularXDrive = jd;
}
break;
case Drives.DriveAngluarYZ:
{
cj.angularYZDrive = jd;
}
break;
case Drives.DriveZ:
{
cj.zDrive = jd;
}
break;
case Drives.DriveY:
{
cj.yDrive = jd;
}
break;
case Drives.DriveSlerp:
{
cj.slerpDrive = jd;
}
break;
}
//

}
}
}

3
Share New Actions / RandomName
« on: September 12, 2016, 10:45:25 PM »
Hi,

I converted a tutorial to a action for another playmaker user.

Quick Tip: How to Code a Simple Character Name Generator
http://gamedevelopment.tutsplus.com/tutorials/quick-tip-how-to-code-a-simple-character-name-generator--gamedev-14308

I would like to add more syllables.

If anyone wants to contribute, that would be great.

Thanks

4
Share New Actions / DrawLineGL
« on: August 26, 2016, 10:47:02 PM »
Hi,

DrawLineGL draws a mesh line in world space.

On the Ecosystem or https://snipt.net/cwmanley/

//TODO

Thanks

5
General Discussion / Skinning/Rigging [Asset]
« on: August 19, 2016, 07:15:41 PM »
Hello,

I have a set of Editor tools for skinning meshes that I am working on.

How much interest is there in a low-cost skinning/rigging solution for Unity?

I still have a lot work to do, but things are moving along really fast.

current features: Skin Wrap, Weight Painting.
 
Thanks  :)

6
Share New Actions / ParticleSystemSetShapeRadius
« on: June 14, 2016, 12:59:58 PM »
Particle System Set Shape Radius Action

On the Ecosystem or https://snipt.net/cwmanley/

//TODO

Thanks

7
Work In Progress... / "Grill Master" Android Game
« on: June 07, 2016, 10:01:06 PM »
Turned-based and Real-time Grilling with Procedural Meat Shaders.

Made with Playmaker and Shader Forge  :D

8
Share New Actions / Puppet Master Actions
« on: June 07, 2016, 09:13:55 PM »
Some Actions for RootMotion's PuppetMaster.
https://www.assetstore.unity3d.com/en/#!/content/48977

Puppet Master Actions

Thanks

9
Playmaker Help / ScritpableObject?[SOLVED]
« on: June 02, 2016, 05:31:25 PM »
Hi,

Is there a way to reference a Scriptable Object from a public FsmObject variable.

Thanks


10
Share New Actions / Particles Move Towards Actions
« on: February 23, 2016, 02:44:26 PM »
Particles Move Towards Game Object, Mesh, and Skinned Mesh.

On the Ecosystem or https://snipt.net/cwmanley/ //TODO

With the Mesh and Skinned Mesh Actions you get all the vertices, a simple cube has 24 vertices instead of 8.

I found a solution using Linq.
Is there any problems with using Linq in Playmaker Actions.

Thanks

11
Share New Actions / Particles Move Towards Position
« on: February 21, 2016, 01:26:51 AM »
Actions are on the Ecosystem or https://snipt.net/cwmanley/

//TODO


12
Share New Actions / ParticleSystemEmitAdavnced
« on: January 22, 2016, 04:26:54 AM »
On the Ecosystem or https://snipt.net/cwmanley/ //Outdated

Emits a Particle and overrides the Particle Systems parameters.

Patch 5.3.1p1

(755423) - Particles: Fixed error message spam on particle systems that have no particles (5.3.1 regression).

Throws this import Warning :(

ParticleSystemEmitAdavnced.cs(50,41): warning CS0618: `UnityEngine.ParticleSystem.Emit(UnityEngine.Vector3, UnityEngine.Vector3, float, float, UnityEngine.Color32)' is obsolete: `Emit with specific parameters is deprecated. Pass a ParticleSystem.EmitParams parameter instead, which allows you to override some/all of the emission properties'

13
Share New Actions / ArrayListSetParticles
« on: January 22, 2016, 04:01:32 AM »
Sets the positions of particles in a particle system using an array.

On the Ecosystem or https://snipt.net/cwmanley/

Code: [Select]
// License: Attribution 4.0 International (CC BY 4.0)
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// Keywords: Particle System Array List

using UnityEngine;
using System.Collections;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("ArrayMaker/ArrayList")]
[Tooltip("Sets the Position, Rotation, Size, Velocity, Color, or Lifetime of Particles in a Particle System using an Array.")]
public class ArrayListSetParticles : ArrayListActions
{

[ActionSection("Set up")]

[RequiredField]
[Tooltip("The GameObject with the PlayMaker ArrayList Proxy component.")]
[CheckForComponent(typeof(PlayMakerArrayListProxy))]
public FsmOwnerDefault gameObject;

[Tooltip("Author defined Reference of the PlayMaker ArrayList Proxy component ( necessary if several component coexists on the same GameObject.")]
public FsmString reference;

public bool everyFrame;

[ActionSection("Source")]

[RequiredField]
[Tooltip("The GameObject with the Particle System.")]
[CheckForComponent(typeof(ParticleSystem))]
public FsmGameObject particleSystem;

[Tooltip("The Particle System's Parameters.")]
public Parameters parameters;

public enum Parameters

{
Position,
Rotation,
Size,
Velocity,
Color,
Lifetime
}


private ParticleSystem _ps;
private Vector3 newVector3;
private float newFloat;
private Color newColor;
private int arrayListCount;


public override void Reset()
{
parameters = Parameters.Position;
everyFrame = false;
}

public override void OnEnter()
{
_ps = particleSystem.Value.GetComponent<ParticleSystem>();

if ( SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject),reference.Value) )
ArrayList();

if (!everyFrame)
Finish();

}

public override void OnUpdate()
{
if ( SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject),reference.Value) )
ArrayList();
}

public void ArrayList()
{
if (!isProxyValid ())
return;
{
switch (parameters)
{
case Parameters.Position:
{
arrayListCount = proxy.arrayList.Count;

ParticleSystem.Particle []particlesArray = new    ParticleSystem.Particle[_ps.particleCount];

_ps.GetParticles(particlesArray);

for(int i = 0; i < _ps.particleCount; ++i)
{
if (i < arrayListCount)
newVector3 = (Vector3) proxy.arrayList[i];
particlesArray[i].position = newVector3;
}     
_ps.SetParticles(particlesArray, _ps.particleCount);
}
break;

case Parameters.Rotation:
{
arrayListCount = proxy.arrayList.Count;

ParticleSystem.Particle []particlesArray = new    ParticleSystem.Particle[_ps.particleCount];

_ps.GetParticles(particlesArray);

for(int i = 0; i < _ps.particleCount; ++i)
{
if (i < arrayListCount)
newFloat = (float) proxy.arrayList[i];
particlesArray[i].rotation = newFloat;
}     
_ps.SetParticles(particlesArray, _ps.particleCount);
}
break;

case Parameters.Size:
{
arrayListCount = proxy.arrayList.Count;

ParticleSystem.Particle []particlesArray = new    ParticleSystem.Particle[_ps.particleCount];

_ps.GetParticles(particlesArray);

for(int i = 0; i < _ps.particleCount; ++i)
{
if (i < arrayListCount)
newFloat = (float) proxy.arrayList[i];
particlesArray[i].startSize = newFloat;
}     
_ps.SetParticles(particlesArray, _ps.particleCount);
}
break;

case Parameters.Velocity:
{
arrayListCount = proxy.arrayList.Count;

ParticleSystem.Particle []particlesArray = new    ParticleSystem.Particle[_ps.particleCount];

_ps.GetParticles(particlesArray);

for(int i = 0; i < _ps.particleCount; ++i)
{
if (i < arrayListCount)
newVector3 = (Vector3) proxy.arrayList[i];
particlesArray[i].velocity = newVector3;
}     
_ps.SetParticles(particlesArray, _ps.particleCount);
}
break;

case Parameters.Color:
{
arrayListCount = proxy.arrayList.Count;

ParticleSystem.Particle []particlesArray = new    ParticleSystem.Particle[_ps.particleCount];

_ps.GetParticles(particlesArray);

for(int i = 0; i < _ps.particleCount; ++i)
{
if (i < arrayListCount)
newColor = (Color) proxy.arrayList[i];
particlesArray[i].startColor = newColor;
}     
_ps.SetParticles(particlesArray, _ps.particleCount);
}
break;

case Parameters.Lifetime:
{
arrayListCount = proxy.arrayList.Count;

ParticleSystem.Particle []particlesArray = new    ParticleSystem.Particle[_ps.particleCount];

_ps.GetParticles(particlesArray);

for(int i = 0; i < _ps.particleCount; ++i)
{
if (i < arrayListCount)
newFloat = (float) proxy.arrayList[i];
particlesArray[i].lifetime = newFloat;
}     
_ps.SetParticles(particlesArray, _ps.particleCount);
}
break;
}
//
}
}

}
}

14
Share New Actions / ArrayListGetParticles
« on: January 22, 2016, 01:17:04 AM »
Gets the positions of particles in a particle system and stores them in a array.

On the Ecosystem or https://snipt.net/cwmanley/

//Updated

Name changed from ArrayListGetPaticlesVector3 which was dumb it should have been ArrayListGetPaticlesPosition, anyway it is just ArrayListGetParticles now.

Gets the Position, Rotation, Size, Velocity, Color, or Lifetime of Particles in a Particle System and stores them in a Array.

Code: [Select]
// License: Attribution 4.0 International (CC BY 4.0)
/*--- __ECO__ __PLAYMAKER__ __ACTION__ ---*/
// Keywords: Particle Array Arraymaker List

using UnityEngine;
using System.Collections;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("ArrayMaker/ArrayList")]
[Tooltip("Gets the Position, Rotation, Size, Velocity, Color, or Lifetime of Particles in a Particle System and stores them in a Array.")]
public class ArrayListGetParticles : ArrayListActions
{

[ActionSection("Set up")]

[RequiredField]
[Tooltip("The gameObject with the PlayMaker ArrayList Proxy component")]
[CheckForComponent(typeof(PlayMakerArrayListProxy))]
public FsmOwnerDefault gameObject;

[Tooltip("Author defined Reference of the PlayMaker ArrayList Proxy component ( necessary if several component coexists on the same GameObject")]
public FsmString reference;

public bool everyFrame;

[ActionSection("Source")]

[RequiredField]
[Tooltip("the GameObject to get the particles from.")]
[CheckForComponent(typeof(ParticleSystem))]
public FsmGameObject particleSystem;

[Tooltip("The Particle System's Parameters.")]
public Parameters parameters;

public enum Parameters

{
Position,
Rotation,
Size,
Velocity,
Color,
Lifetime
}

private ParticleSystem.Particle[] particlesArray;
        private ParticleSystem _ps;
private Vector3[] particles;
private int numParticlesAlive;
private Color[] particlesColor;
private float[] particlesFloat;

public override void Reset()
{
parameters = Parameters.Position;
everyFrame = false;
}

public override void OnEnter()
{
_ps = particleSystem.Value.GetComponent<ParticleSystem>();

if ( SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject),reference.Value) )
ArrayList();

if (!everyFrame)
Finish();
}

public override void OnUpdate()
{
if ( SetUpArrayListProxyPointer(Fsm.GetOwnerDefaultTarget(gameObject),reference.Value) )
ArrayList();
}

public void ArrayList()
{
if (!isProxyValid ())
return;
{
switch (parameters)
{
case Parameters.Position:

InitializeIfNeeded();

numParticlesAlive = _ps.GetParticles(particlesArray);
particles = new Vector3[numParticlesAlive];

for (int i = 0; i < numParticlesAlive; i++)
{
proxy.arrayList.Clear();
particles[i] = particlesArray[i].position;
proxy.arrayList.InsertRange(0,particles);
}
break;

case Parameters.Rotation:

InitializeIfNeeded();

numParticlesAlive = _ps.GetParticles(particlesArray);
particlesFloat = new float[numParticlesAlive];

for (int i = 0; i < numParticlesAlive; i++)
{
proxy.arrayList.Clear();
particlesFloat[i] = particlesArray[i].rotation;
proxy.arrayList.InsertRange(0,particlesFloat);
}
break;

case Parameters.Size:

InitializeIfNeeded();

numParticlesAlive = _ps.GetParticles(particlesArray);
particlesFloat = new float[numParticlesAlive];

for (int i = 0; i < numParticlesAlive; i++)
{
proxy.arrayList.Clear();
particlesFloat[i] = particlesArray[i].startSize;
proxy.arrayList.InsertRange(0,particlesFloat);
}
break;

case Parameters.Velocity:

InitializeIfNeeded();

numParticlesAlive = _ps.GetParticles(particlesArray);
particles = new Vector3[numParticlesAlive];

for (int i = 0; i < numParticlesAlive; i++)
{
proxy.arrayList.Clear();
particles[i] = particlesArray[i].velocity;
proxy.arrayList.InsertRange(0,particles);
}
break;

case Parameters.Color:

InitializeIfNeeded();

numParticlesAlive = _ps.GetParticles(particlesArray);
particlesColor = new Color[numParticlesAlive];

for (int i = 0; i < numParticlesAlive; i++)
{
proxy.arrayList.Clear();
particlesColor[i] = particlesArray[i].startColor;
proxy.arrayList.InsertRange(0,particlesColor);
}
break;

case Parameters.Lifetime:

InitializeIfNeeded();

numParticlesAlive = _ps.GetParticles(particlesArray);
particlesFloat = new float[numParticlesAlive];

for (int i = 0; i < numParticlesAlive; i++)
{
proxy.arrayList.Clear();
particlesFloat[i] = particlesArray[i].lifetime;
proxy.arrayList.InsertRange(0,particlesFloat);
}
break;
}
InitializeIfNeeded();
}
}

public void InitializeIfNeeded()
{
if (particlesArray == null || particlesArray.Length < _ps.maxParticles)
particlesArray = new ParticleSystem.Particle[_ps.maxParticles];
        }
}
}

15
Share New Actions / ParticleSystemSetCycle
« on: January 21, 2016, 10:32:21 PM »
On the Ecosystem or https://snipt.net/cwmanley/

//TODO

Pages: [1] 2