本文整理汇总了C#中ParticleEmitter类的典型用法代码示例。如果您正苦于以下问题:C# ParticleEmitter类的具体用法?C# ParticleEmitter怎么用?C# ParticleEmitter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParticleEmitter类属于命名空间,在下文中一共展示了ParticleEmitter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start() {
// We actually need the renderer for the sprite
// Actually get a reference to SpriteFollowPlayer and make that do the work
playerSpriteManager = GetComponent<SpriteFollowPlayer>();
minimapSpriteRenderer = transform.Find("Minimap Icon").GetComponent<Renderer>();
seekerParticleEmitter = transform.Find("Echo'd Particle Emitter").GetComponent<ParticleEmitter>();
}
示例2: Emit
public void Emit(ParticleEmitter emitter)
{
for (int i = 0; i < _particleSystems.Count; i++)
{
_particleSystems[i].Emit(emitter);
}
}
示例3: Start
protected override void Start()
{
base.Start();
if( fingerStationaryObject )
stationaryParticleEmitter = fingerStationaryObject.GetComponentInChildren<ParticleEmitter>();
}
示例4: ParticleEffectInstanceManager
public ParticleEffectInstanceManager(EffectManager effect_manager, Mesh character_mesh, bool letter_flipped, ParticleEffectSetup effect_setup, AnimationProgressionVariables progression_vars, AnimatePerOptions animate_per, ParticleEmitter particle_emitter = null, ParticleSystem particle_system = null)
{
m_particle_emitter = particle_emitter;
m_particle_system = particle_system;
m_letter_mesh = character_mesh;
m_letter_flipped = letter_flipped;
m_follow_mesh = effect_setup.m_follow_mesh;
m_duration = effect_setup.m_duration.GetValue(progression_vars, animate_per);
m_delay = effect_setup.m_delay.GetValue(progression_vars, animate_per);
m_position_offset = effect_setup.m_position_offset.GetValue(progression_vars, animate_per);
m_rotation_offset = Quaternion.Euler(effect_setup.m_rotation_offset.GetValue(progression_vars, animate_per));
m_rotate_with_letter = effect_setup.m_rotate_relative_to_letter;
m_effect_manager_handle = effect_manager;
m_active = false;
if (m_particle_emitter != null)
{
m_transform = m_particle_emitter.transform;
m_particle_emitter.emit = true;
m_particle_emitter.enabled = false;
}
else if (m_particle_system != null)
{
m_transform = m_particle_system.transform;
m_particle_system.playOnAwake = false;
m_particle_system.Play();
#if !UNITY_3_5 && UNITY_EDITOR
p_system_timer = 0;
#endif
}
}
示例5: RegisterEffect
public void RegisterEffect(string name, EmitterData data)
{
Emitters[name] = new ParticleEmitter(Components, name, Components.RootComponent, Matrix.Identity, data);
Emitters[name].DepthSort = false;
Emitters[name].Tint = Color.White;
Emitters[name].FrustrumCull = false;
}
示例6: Awake
/* METHODES */
//Constructor
void Awake()
{
//Lien avec les composants des particules
GemPartEmitter = GetComponent<ParticleEmitter>(); //Lien avec l'Emitter des particules
GemPartAnimation = GetComponent<ParticleAnimator>(); //Lien avec l'Animator des particules
InitialColor = Color.magenta; //Définition de la couleur initiale de la Gemme
OppositeColor = new Color32(255,132,0,255); //Définition de la couleur opposé de la Gemme
//Initialisation du tableau dynamiquement
GemPartStarkle = new Color[5]; //Initialisation des 5 couleurs comosant le Renderer
//Lien avec la Lumière
GemLight = GetComponent<Light>();
GemTitle = GameObject.Find("Title").GetComponent<TextMesh>(); //Lien avec le GUIText de la scène
//Initialisation des statuts
GemPartEmitter.emit = false; //Dissimulation des particules
GemTitle.renderer.enabled = false; //Dissimulation du texte
ChangeMode = false;
//Récuparation des scripts
Blue = GameObject.FindGameObjectWithTag("Blue").GetComponent<BlueGem>();
Yellow = GameObject.FindGameObjectWithTag("Yellow").GetComponent<YellowGem>();
White = GameObject.FindGameObjectWithTag("White").GetComponent<WhiteGem>();
Black = GameObject.FindGameObjectWithTag("Black").GetComponent<BlackGem>();
Red = GameObject.FindGameObjectWithTag("Red").GetComponent<RedGem>();
}
示例7: Start
void Start()
{
mEmitter = GetComponent<ParticleEmitter>();
mControl = Tools.FindInParents<Spaceship>(transform);
mEmission = new Vector2(mEmitter.minEmission, mEmitter.maxEmission);
mDir = transform.rotation * Vector3.back;
}
示例8: Awake
void Awake ()
{
mytransform = transform;
myparticle = GetComponent<ParticleEmitter>();
mymaterial = GetComponent<Renderer>().sharedMaterial;
mycollider = GetComponent<Collider>();
}
示例9: Start
// Use this for initialization
void Start()
{
//input = biometricController.GetComponent("BioController") as Controller_Wild_Divine;
smoke = GameObject.Find("Smoke").GetComponent("ParticleEmitter") as ParticleEmitter;
inner = GameObject.Find("InnerCore").GetComponent("ParticleEmitter") as ParticleEmitter;
outer = GameObject.Find("OuterCore").GetComponent("ParticleEmitter") as ParticleEmitter;
}
示例10: Start
// Use this for initialization
void Start () {
hidingPlaceLayerMask = 1 << layerIndex;
id = GetComponent<PlayerIdentity>();
echoParticleEmitter = GetComponentInChildren<ParticleEmitter>();
ui = GetComponentInChildren<InWorldUI>();
sfxManager = GetComponentInChildren<NetworkedSFXManager>();
}
示例11: Start
void Start()
{
if( !emitter )
emitter = GetComponent<ParticleEmitter>();
emitter.emit = false;
}
示例12: Awake
void Awake()
{
emitter = GetComponent<ParticleEmitter>();
if (whenToEmit == WhenToEmit.Awake)
Emit(quantityToEmit);
}
示例13: Awake
/* METHODES */
//Constructor
void Awake()
{
// A retenir : GemLight = gameObject.AddComponent("Light") as Light;
//Lien avec les composants des particules
GemPartEmitter = GetComponent<ParticleEmitter>(); //Lien avec l'Emitter des particules
GemPartAnimation = GetComponent<ParticleAnimator>(); //Lien avec l'Animator des particules
//GemPartRenderer = GetComponent<ParticleRenderer>(); //Lien avec le Renderer des particules
InitialColor = Color.yellow; //Définition de la couleur initiale de la Gemme
OppositeColor = Color.magenta; //Définition de la couleur opposé de la Gemme
//Initialisation du tableau dynamiquement
GemPartStarkle = new Color[5]; //Initialisation des 5 couleurs comosant le Renderer
//Lien avec la Lumière
GemLight = GetComponent<Light>();
GemTitle = GameObject.Find("GUI Text"); //Lien avec le GUIText de la scène
//Initialisation des statuts
GemPartEmitter.emit = false; //Dissimulation des particules
GemTitle.guiText.enabled = false; //Dissimulation du texte
MyPart = (ParticleSystem) Instantiate(test);
ChangeMode = false;
}
示例14: DrawEmitter
private void DrawEmitter(GraphicsDevice device, Effect effect, ParticleEmitter emitter)
{
if (emitter.LiveParticles == 0)
return;
effect.Parameters["Time"].SetValue(emitter.Time);
effect.Parameters["Acceleration"].SetValue(emitter.Acceleration);
effect.Parameters["LifeSpan"].SetValue(emitter.LifeSpan);
ParticleStateType[] instances = emitter.Particles;
if (m_InstanceBuffer.VertexCount < instances.Length)
{
m_InstanceBuffer.Dispose();
m_InstanceBuffer = new DynamicVertexBuffer(device, typeof(ParticleStateType), 2 * instances.Length, BufferUsage.WriteOnly);
}
m_InstanceBuffer.SetData(instances, 0, emitter.LiveParticles, SetDataOptions.Discard);
var particleres = m_ParticleBuffer.GetResource();
device.SetVertexBuffers(
new VertexBufferBinding(particleres.Buffer, 0, 0),
new VertexBufferBinding(m_InstanceBuffer, 0, 1)
);
device.Indices = m_IndexBuffer;
foreach (EffectPass pass in effect.CurrentTechnique.Passes)
{
pass.Apply();
device.DrawInstancedPrimitives(PrimitiveType.TriangleList,
0, 0, particleres.NumVertices, 0, particleres.PrimitiveCount, emitter.LiveParticles);
}
}
示例15: Awake
private Vector3 _tmpPos; //calculated position... randomized inside sphere of incoming radius * size
#endregion Fields
#region Methods
public void Awake()
{
_particleEmitter = (gameObject.AddComponent<EllipsoidParticleEmitter>()) as ParticleEmitter;
_particleRenderer = (gameObject.AddComponent<ParticleRenderer>()) as ParticleRenderer;
_particleAnimator = (gameObject.AddComponent<ParticleAnimator>()) as ParticleAnimator;
_particleRenderer.sortingLayerName = "Topmost";
_particleEmitter.hideFlags = HideFlags.HideAndDontSave;
_particleRenderer.hideFlags = HideFlags.HideAndDontSave;
_particleAnimator.hideFlags = HideFlags.HideAndDontSave;
_particleAnimator.damping = _baseDamping;
_particleEmitter.emit = false;
_particleRenderer.maxParticleSize = maxScreenSize;
_particleRenderer.material = material;
_particleRenderer.material.color = Color.white; //workaround for this not being settable elsewhere
_particleAnimator.sizeGrow = sizeGrow;
if (explodeOnAwake)
{
Explode();
}
}