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.


Messages - brzozowsky

Pages: [1]
1
Share New Actions / Re: Round Float with decimal places
« on: January 19, 2012, 05:07:58 AM »
Hmm, good idea. I have edit the code.
Now you can store the result as String. See the first post.

2
Share New Actions / Round Float with decimal places
« on: January 18, 2012, 11:29:24 AM »
Round Float with decimal places.

EXAMPLE:
Source Float: < 54.2486234 >
- Result Float with "None" decimal places: < 54 >
- Result Float with "One" decimal places: < 54.2 >
- Result Float with "Two" decimal places: < 54.24 >
- Result Float with "Three" decimal places: < 54.248 >
- Result Float with "Four" decimal places: < 54.2486 >

EDIT: Now you can store the result as a String!


Code: [Select]
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
using UnityEngine;
using System.Collections;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Convert)]
[Tooltip("Round Float with decimal places.")]
public class FloatRound : FsmStateAction
{
public enum Operation
{
None,
One,
Two,
Three,
Four
}
[RequiredField]
[UIHint(UIHint.Variable)]
public FsmFloat floatVariable;
[UIHint(UIHint.Variable)]
public FsmFloat storeFloatResult;
[UIHint(UIHint.Variable)]
public FsmString storeStringResult;
public Operation decimalPlaces = Operation.Two;
public bool everyFrame;
public override void Reset()
{
floatVariable = null;
storeFloatResult = null;
storeStringResult = null;
decimalPlaces = Operation.Two;
everyFrame = false;
}
public override void OnEnter()
{
DoConvertFloat();
if (!everyFrame)
Finish();
}
public override void OnUpdate()
{
DoConvertFloat();
}
void DoConvertFloat()
{
if (storeFloatResult != null)
{
switch (decimalPlaces)
{
case Operation.None:
storeFloatResult.Value = Mathf.Round(floatVariable.Value);
break;
case Operation.One:
storeFloatResult.Value = Mathf.Round((floatVariable.Value)*10f)/10f;
break;
case Operation.Two:
storeFloatResult.Value = Mathf.Round((floatVariable.Value)*100f)/100f;
break;
case Operation.Three:
storeFloatResult.Value = Mathf.Round((floatVariable.Value)*1000f)/1000f;
break;
case Operation.Four:
storeFloatResult.Value = Mathf.Round((floatVariable.Value)*10000f)/10000f;
break;
default:
break;
}
}
if (storeStringResult != null)
{
switch (decimalPlaces)
{
case Operation.None:
storeStringResult.Value = floatVariable.Value.ToString ("F" + 0.0);
break;
case Operation.One:
storeStringResult.Value = floatVariable.Value.ToString ("F" + 1.0);
break;
case Operation.Two:
storeStringResult.Value = floatVariable.Value.ToString ("F" + 2.0);
break;
case Operation.Three:
storeStringResult.Value = floatVariable.Value.ToString ("F" + 3.0);
break;
case Operation.Four:
storeStringResult.Value = floatVariable.Value.ToString ("F" + 4.0);
break;
default:
break;
}
}
}
}
}

3
User Showcase / Re: Chrome Memory Game v1.1
« on: January 03, 2012, 09:35:36 AM »
Why you can't play it? You mean this link?
http://brzozowsky.bplaced.net/?page_id=213

4
User Showcase / Chrome Memory Game v1.1
« on: January 02, 2012, 06:02:42 PM »
Here is my little project, created in 24 hours. Is a classic memory game for kids.
Developed with Unity3D, Playmaker, 3DSMAX 2012, Photoshop CS6.



You can play this game in your browser or download a hi-res version for your pc on my website: http://brzozowsky.bplaced.net

- Play now in your browser: http://brzozowsky.bplaced.net/?page_id=213
- Download hi-res PC version: http://brzozowsky.bplaced.net/wp-content/uploads/2012/01/setup.rar

- You can watch the developing video here:


5
Official Action Updates / Re: Substance Actions
« on: December 02, 2011, 09:01:42 AM »
Very useful, thanks!

6
Playmaker Help / Re: a bouncing ball effect
« on: November 18, 2011, 07:02:30 AM »
Yes, you can add the value "-3" to the "first_speed" float in the second state.

7
Playmaker Help / Re: a bouncing ball effect
« on: November 18, 2011, 04:37:01 AM »
The "first_speed" is a vector3 variable. Of course, you can enter a value without the predefined vector3.

8
Playmaker Help / Re: a bouncing ball effect
« on: November 17, 2011, 10:29:15 AM »
Yes, here is the Physic Material for the ball:


And for the first ball speed add the value to the "first_speed" variable in the ball FSM:
X: 0
Y: 0
Z: -3

9
Playmaker Help / Re: a bouncing ball effect
« on: November 16, 2011, 09:24:38 AM »
I use custom physic for the bouncing.
Small tutorial for perfect bouncing:

First you must edit the global physic under EDIT -> Project Settings -> Physics:


Second the Fixed Timestep under EDIT -> Project Settings -> Time:


And now the Ball:
-Sphere collider and Rigidbody:


and the Ball FSM:


at last, you must set the tag "wall" to all walls in the scene and the tag "stone" to your stones.

The ball speed you can modify with the variable "first_speed". set it to 3 for normal speed.

10
Playmaker Help / Re: a bouncing ball effect
« on: November 15, 2011, 05:26:55 PM »
Yes, ist possible.
See my actual project on my website: http://unity3d.bplaced.net/?page_id=332

11
Playmaker Help / Re: GUI Element Hit Test help [Solved]
« on: August 25, 2011, 07:19:04 AM »
yes, set the vector to 0 on the first state. this works. very useful for me, thanks!

12
Playmaker Help / Read PlayerPrefs in new scene?
« on: August 04, 2011, 04:11:20 PM »
I have stored some float values in my first game scene, now i will read the same values in the second game scene. Is it possible? How can i make this?

Pages: [1]