Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » Particle Modifier Script by BryceCain25

Particle Modifier Script by BryceCain25

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Particle Modifier Script by BryceCain25 on Sun Oct 26, 2014 12:39 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
Hi!
today I have made a new particle modifier script...
this is basically just to show how to use the particle with variables..
if you press Up Arrow (using Keycode.UpArrow) you can increase the particle Size..
and vice versa
the thing is with this script, the Multiplier I may have messed up...to what I may be thinking is:
since 1*5 = 5, and -1*5 = -5, this case you would have the particle increase on a negative scale...which in match terms this seems really weird to have a negative scale for increasing integers..it works I guess...
It may seem extremely hard to get used to, so indeed I will rewrite a full script that people can use if they insist I do..


here is the script: (JavaScript, UnityScript)
Code:
var theparticle : Particle;
var multiplier : int;
var decrease : int;
var minimumenergy : int;
var minimumsize : int;
var maximumsize : int;
var maximumenergy : int;
function Start () {
theparticle.startEnergy = minimumenergy; //this will start the the particle system with
//the minimum energy possible...
theparticle.size = minimumsize; //this will start the particle system with the minimum size..
Check();
Checktwo();
}

function Update () {
if(Input.GetKeyDown(KeyCode.DownArrow)) {
theparticle.size = theparticle.size*multiplier;
}
if(Input.GetKeyDown(KeyCode.UpArrow)) {
theparticle.size = theparticle.size/multiplier;
}

}

function Check () {
if(theparticle.size == maximumsize) {
theparticle.size = minimumsize;
}
}


function Checktwo () {
if(theparticle.energy == maximumenergy) {
theparticle.energy = minimumenergy;
}
}

Thank you!

View user profile

2 Re: Particle Modifier Script by BryceCain25 on Sun Oct 26, 2014 1:49 pm

Very interesting! Thanks for the share Bryce.

View user profile http://www.youtube.com/user/misterninjaboy

3 Re: Particle Modifier Script by BryceCain25 on Sun Oct 26, 2014 1:54 pm

NewDeveloper


Moderator
Moderator
Great share BryceCain25.

--New Developer

View user profile

4 Re: Particle Modifier Script by BryceCain25 on Sun Oct 26, 2014 4:47 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
MisterNinjaBoy wrote:Very interesting! Thanks for the share Bryce.
Thank you! Very Happy

View user profile

5 Re: Particle Modifier Script by BryceCain25 on Sun Oct 26, 2014 4:47 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
NewDeveloper wrote:Great share BryceCain25.

--New Developer
Thanks! Very Happy

View user profile

6 Re: Particle Modifier Script by BryceCain25 on Tue Oct 28, 2014 12:54 pm

developer23


Moderator
Moderator
Great Bryce Very Happy

View user profile http://masterdevelopers.altervista.org/

7 Re: Particle Modifier Script by BryceCain25 on Sun Nov 09, 2014 6:02 pm

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
developer23 wrote:Great Bryce Very Happy
Thank you!

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum