Skip to content

Instantly share code, notes, and snippets.

@whaison
Created August 9, 2015 03:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whaison/17679877377bf8c5a641 to your computer and use it in GitHub Desktop.
Save whaison/17679877377bf8c5a641 to your computer and use it in GitHub Desktop.
this Code is Non Error But Do Not Work On Unity this is Dust Code Sorry....
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine.Internal;
using System.Runtime.CompilerServices;
using System.Security;
using UnityEngine.Internal;
using UnityEngineInternal;
using UnityEngine;
namespace jp.jugem.whaison
{
//public class ParticleSystem : Component,MonoBehaviour
public class ParticleSystem : MonoBehaviour
{
//
// Properties
//
public float duration ;
public float emissionRate ;
public bool enableEmission ;
public float gravityModifier ;
public bool isPaused ;
public bool isPlaying ;
public bool isStopped ;
public bool loop;
public int maxParticles ;
public int particleCount ;
public float playbackSpeed ;
public bool playOnAwake;
public uint randomSeed ;
public int safeCollisionEventSize ;
public ParticleSystemSimulationSpace simulationSpace ;
Color startColorValue;
public Color startColor {
get {
//Color result;
//this.INTERNAL_get_startColor (out result);
//return result;
return startColorValue;
}
set {
startColorValue=value;
//this.INTERNAL_set_startColor (ref value);
}
}
public float startDelay ;
public float startLifetime ;
public float startRotation ;
public float startSize ;
public float startSpeed ;
public float time;
//
// Methods
//
public void GetDirectParticleSystemChildrenRecursive (Transform transform, List<ParticleSystem> particleSystems)
{
foreach (Transform transform2 in transform) {
ParticleSystem component = transform2.gameObject.GetComponent<ParticleSystem> ();
if (component != null) {
particleSystems.Add (component);
//ParticleSystem.GetDirectParticleSystemChildrenRecursive (transform2, particleSystems);
}
}
}
ParticleSystem[] GetParticleSystems (ParticleSystem root)
{
//if (!root) {
// return ;
//}
List<ParticleSystem> list = new List<ParticleSystem> ();
list.Add (root);
// ParticleSystem.GetDirectParticleSystemChildrenRecursive (root.transform, list);
return list.ToArray ();
}
// public void INTERNAL_CALL_Emit (ParticleSystem self, int count);
//
// Methods
//
public void Clear ()
{
//bool withChildren ;
//this.Clear (withChildren);
}
public void Clear ( bool withChildren)
{
if (withChildren) {
//ParticleSystem[] particleSystems = ParticleSystem.GetParticleSystems (this);
//ParticleSystem[] array = particleSystems;
//for (int i ; i < array.Length; i++) {
// ParticleSystem particleSystem = array [i];
// particleSystem.Internal_Clear ();
//}
}
else {
//this.Internal_Clear ();
}
}
public void Emit (int count)
{
//ParticleSystem.INTERNAL_CALL_Emit (this, count);
}
public void Emit (Vector3 position, Vector3 velocity, float size, float lifetime, Color32 color)
{
ParticleSystem.Particle particle = default(ParticleSystem.Particle);
particle.position = position;
particle.velocity = velocity;
particle.lifetime = lifetime;
particle.startLifetime = lifetime;
particle.size = size;
//particle.rotation ;
//particle.angularVelocity ;
particle.color = color;
//particle.randomSeed ;
//this.Internal_Emit (ref particle);
}
public void Emit (ParticleSystem.Particle particle)
{
//this.Internal_Emit (ref particle);
}
//public int GetParticles (UnityEngine.ParticleSystem.Particle[] particles);
// public void Internal_Clear ();
// public void Internal_Emit (ref ParticleSystem.Particle particle);
// public void INTERNAL_get_startColor (out Color value);
// public bool Internal_IsAlive ();
// public void Internal_Pause ();
// public void Internal_Play ();
// public void INTERNAL_set_startColor (ref Color value);
// public void Internal_Simulate (float t, bool restart);
// public void Internal_Stop ();
public bool IsAlive ()
{
//bool withChildren ;
//return this.IsAlive (withChildren);
return true;
}
public bool IsAlive ( bool withChildren)
{
if (withChildren) {
//ParticleSystem[] particleSystems = ParticleSystem.GetParticleSystems (this);
//ParticleSystem[] array = particleSystems;
//for (int i ; i < array.Length; i++) {
// ParticleSystem particleSystem = array [i];
// if (particleSystem.Internal_IsAlive ()) {
// return ;
// }
//}
return true;
}
//return this.Internal_IsAlive ();
return true;
}
public void Pause ()
{
bool withChildren ;
//this.Pause (withChildren);
}
public void Pause ( bool withChildren)
{
if (withChildren) {
//ParticleSystem[] particleSystems = ParticleSystem.GetParticleSystems (this);
//ParticleSystem[] array = particleSystems;
//for (int i ; i < array.Length; i++) {
// ParticleSystem particleSystem = array [i];
// particleSystem.Internal_Pause ();
//}
}
else {
//this.Internal_Pause ();
}
}
public void Play ()
{
bool withChildren ;
//this.Play (withChildren);
}
public void Play ( bool withChildren)
{
if (withChildren) {
//ParticleSystem[] particleSystems = ParticleSystem.GetParticleSystems (this);
//ParticleSystem[] array = particleSystems;
//for (int i ; i < array.Length; i++) {
// ParticleSystem particleSystem = array [i];
// particleSystem.Internal_Play ();
//}
}
else {
//this.Internal_Play ();
}
}
//public void SetParticles (ParticleSystem.Particle[] particles, int size);
// void SetupDefaultType (int type);
public void Simulate (float t, bool withChildren)
{
bool restart ;
//this.Simulate (t, withChildren, restart);
}
public void Simulate (float t)
{
bool restart ;
bool withChildren ;
//this.Simulate (t, withChildren, restart);
}
public void Simulate (float t, bool withChildren, bool restart)
{
if (withChildren) {
//ParticleSystem[] particleSystems = ParticleSystem.GetParticleSystems (this);
//ParticleSystem[] array = particleSystems;
//for (int i ; i < array.Length; i++) {
// ParticleSystem particleSystem = array [i];
// particleSystem.Internal_Simulate (t, restart);
//}
}
else {
//this.Internal_Simulate (t, restart);
}
}
/*
public void _Stop ()
{
bool withChildren;
this._Stop (withChildren);
}
public void _Stop ( bool withChildren)
{
if (withChildren) {
ParticleSystem[] particleSystems = ParticleSystem.GetParticleSystems (this);
ParticleSystem[] array = particleSystems;
for (int i ; i < array.Length; i++) {
ParticleSystem particleSystem = array [i];
particleSystem.Internal_Stop ();
}
}
else {
this.Internal_Stop ();
}
}
*/
//
// Nested Types
//
public struct CollisionEvent
{
}
public struct Particle
{
public Vector3 position ;
public Vector3 velocity {
get {
return this.m_Velocity;
}
set {
this.m_Velocity = value;
}
}
public Vector3 m_Velocity;
public float lifetime {
get {
return this.m_Lifetime;
}
set {
this.m_Lifetime = value;
}
}
public float m_Lifetime;
public float startLifetime {
get {
return this.m_StartLifetime;
}
set {
this.m_StartLifetime = value;
}
}
public float m_StartLifetime;
public float size {
get {
return this.m_Size;
}
set {
this.m_Size = value;
}
}
public float m_Size;
public Vector3 axisOfRotation {
get {
return this.m_AxisOfRotation;
}
set {
this.m_AxisOfRotation = value;
}
}
public Vector3 m_AxisOfRotation;
public float rotation {
get {
return this.m_Rotation ;
}
set {
this.m_Rotation = value ;
}
}
public float m_Rotation;
public float angularVelocity {
get {
return this.m_AngularVelocity ;
}
set {
this.m_AngularVelocity = value ;
}
}
public float m_AngularVelocity;
public Color32 color {
get {
return this.m_Color;
}
set {
this.m_Color = value;
}
}
public Color32 m_Color;
public float randomValue {
get {
return BitConverter.ToSingle (BitConverter.GetBytes (this.m_RandomSeed),new int());
}
set {
this.m_RandomSeed = BitConverter.ToUInt32 (BitConverter.GetBytes (value),new int());
}
}
public uint randomSeed {
get {
return this.m_RandomSeed;
}
set {
this.m_RandomSeed = value;
}
}
public uint m_RandomSeed;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment