本文整理汇总了C#中UnityEngine.ParticleSystem.Pause方法的典型用法代码示例。如果您正苦于以下问题:C# ParticleSystem.Pause方法的具体用法?C# ParticleSystem.Pause怎么用?C# ParticleSystem.Pause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem.Pause方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
void Start()
{
controller = new Controller ();
controller.EnableGesture (Gesture.GestureType.TYPE_SWIPE);
controller.EnableGesture (Gesture.GestureType.TYPE_CIRCLE);
controller.EnableGesture (Gesture.GestureType.TYPE_SCREEN_TAP);
//for swipe
controller.Config.SetFloat ("Gesture.Swipe.MinLength", 200.0f);
controller.Config.SetFloat ("Gesture.Swipe.MinVelocity", 750f);
//for circle
controller.Config.SetFloat ("Gesture.Circle.MinRadius", 80.0f);
controller.Config.SetFloat ("Gesture.Circle.MinArc", 1.8f);
//for screen tap
controller.Config.SetFloat ("Gesture.ScreenTap.MinForwardVelocity", 1.0f);
controller.Config.SetFloat ("Gesture.ScreenTap.HistorySeconds", .05f);
controller.Config.SetFloat ("Gesture.ScreenTap.MinDistance", 1.0f);
controller.Config.Save ();
timeLimit = 5.0f;
timer = 0.0f;
p = GameObject.Find ("ps").GetComponent<ParticleSystem> ();
before = GameObject.Find ("before").GetComponent<SpriteRenderer> ();
after = GameObject.Find ("after").GetComponent<SpriteRenderer> ();
after.color = new Color (255, 255, 255, 0);
p.Pause ();
}
示例2: Start
// Use this for initialization
void Start () {
this.attackspeed = .5f;
particles = GetComponent<ParticleSystem> ();
particles.Pause ();
this.Power = 20;
this.range = 30;
this.upgradeCost = 600;
}
示例3: charge
public void charge(GameObject particles)
{
partSys = particles.GetComponent<ParticleSystem> ();
if (currentBattery < maxBattery) {
partSys.Pause ();
isCharging = true;
} else
partSys.Clear ();
}
示例4: Start
// Use this for initialization
void Start()
{
smallJetStream = null;
largeJetEmitter = largeJetStream.GetComponent<ParticleSystem> ();
largeJetEmitter.Pause ();
powerBar.fillAmount = 0;
CatAnimator = GetComponent<Animator> ();
Player = GetComponent<Rigidbody2D>();
CatAnimator.SetBool("notgrounded", false);
grounded = true;
time = true;
jumpyReady = false;
meowSource = WallOfScore.GetComponent<AudioSource> ();
}
示例5: Start
// Use this for initialization
void Start()
{
//this returns the sibling particle system
particleSystem = GetComponent<ParticleSystem>();
spriteRender = GetComponent<SpriteRenderer>();
particleSystem.Pause();
spriteRender.enabled = false;
collider2D.enabled = false;
rockfallState = 0;
timeElapsed = 0;
velocity = new Vector3(0, 0, 0);
tag = "DamagingHazard";
//run initializations for the base class
base.Start();
}
示例6: Awake
void Awake()
{
lights = gameObject.GetComponentsInChildren<Light>();
flames = gameObject.GetComponentInChildren<ParticleSystem>();
if ((row == 0 || row == 2) || (column == 0 || column == 2))
{
lights[0].enabled = false;
lights[1].enabled = false;
lights[2].enabled = false;
flames.Pause();
flames.Clear();
isActive = false;
}
puzzleManager = GameObject.FindObjectOfType<LightsOn>();
}
示例7: OnEnter
public override void OnEnter()
{
GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
if (go == null)
{
return;
}
_ps = go.GetComponent<ParticleSystem>();
if (_ps == null)
{
return;
}
_ps.Pause();
Finish();
}
示例8: HandleKeyboardShortcuts
private void HandleKeyboardShortcuts(ParticleSystem root)
{
Event current = Event.current;
if (current.type == EventType.KeyDown)
{
int num = 0;
if (current.keyCode == ParticleEffectUI.kPlay.keyCode)
{
if (EditorApplication.isPlaying)
{
this.Stop();
this.Play();
}
else
{
if (!ParticleSystemEditorUtils.editorIsPlaying)
{
this.Play();
}
else
{
this.Pause();
}
}
current.Use();
}
else
{
if (current.keyCode == ParticleEffectUI.kStop.keyCode)
{
this.Stop();
current.Use();
}
else
{
if (current.keyCode == ParticleEffectUI.kReverse.keyCode)
{
num = -1;
}
else
{
if (current.keyCode == ParticleEffectUI.kForward.keyCode)
{
num = 1;
}
}
}
}
if (num != 0)
{
ParticleSystemEditorUtils.editorIsScrubbing = true;
float editorSimulationSpeed = ParticleSystemEditorUtils.editorSimulationSpeed;
float num2 = ((!current.shift) ? 1f : 3f) * this.m_TimeHelper.deltaTime * ((num <= 0) ? -3f : 3f);
ParticleSystemEditorUtils.editorPlaybackTime = Mathf.Max(0f, ParticleSystemEditorUtils.editorPlaybackTime + num2 * editorSimulationSpeed);
if (root.isStopped)
{
root.Play();
root.Pause();
}
ParticleSystemEditorUtils.PerformCompleteResimulation();
current.Use();
}
}
if (current.type == EventType.KeyUp && (current.keyCode == ParticleEffectUI.kReverse.keyCode || current.keyCode == ParticleEffectUI.kForward.keyCode))
{
ParticleSystemEditorUtils.editorIsScrubbing = false;
}
}
示例9: PlayBackTimeGUI
internal void PlayBackTimeGUI(ParticleSystem root)
{
if (root == null)
{
root = ParticleSystemEditorUtils.GetRoot(this.m_SelectedParticleSystem);
}
EventType type = Event.current.type;
int hotControl = GUIUtility.hotControl;
string kFloatFieldFormatString = EditorGUI.kFloatFieldFormatString;
EditorGUI.BeginChangeCheck();
EditorGUI.kFloatFieldFormatString = ParticleEffectUI.s_Texts.secondsFloatFieldFormatString;
float num = EditorGUILayout.FloatField(ParticleEffectUI.s_Texts.previewTime, ParticleSystemEditorUtils.editorPlaybackTime, new GUILayoutOption[0]);
EditorGUI.kFloatFieldFormatString = kFloatFieldFormatString;
if (EditorGUI.EndChangeCheck())
{
if (type == EventType.MouseDrag)
{
ParticleSystemEditorUtils.editorIsScrubbing = true;
float editorSimulationSpeed = ParticleSystemEditorUtils.editorSimulationSpeed;
float editorPlaybackTime = ParticleSystemEditorUtils.editorPlaybackTime;
float num2 = num - editorPlaybackTime;
num = editorPlaybackTime + num2 * (0.05f * editorSimulationSpeed);
}
num = Mathf.Max(num, 0f);
ParticleSystemEditorUtils.editorPlaybackTime = num;
if (root.isStopped)
{
root.Play();
root.Pause();
}
ParticleSystemEditorUtils.PerformCompleteResimulation();
}
if (type == EventType.MouseDown && GUIUtility.hotControl != hotControl)
{
this.m_IsDraggingTimeHotControlID = GUIUtility.hotControl;
ParticleSystemEditorUtils.editorIsScrubbing = true;
}
if (this.m_IsDraggingTimeHotControlID != -1 && GUIUtility.hotControl != this.m_IsDraggingTimeHotControlID)
{
this.m_IsDraggingTimeHotControlID = -1;
ParticleSystemEditorUtils.editorIsScrubbing = false;
}
}
示例10: Start
void Start()
{
ps = gameObject.GetComponentInChildren<ParticleSystem>();
if (ps != null)
ps.Pause();
}
示例11: HandleKeyboardShortcuts
private void HandleKeyboardShortcuts(ParticleSystem root)
{
Event current = Event.current;
if (current.type == EventType.KeyDown)
{
int num = 0;
if (current.keyCode == (Event) ParticleEffectUI.kPlay.keyCode)
{
if (EditorApplication.isPlaying)
{
this.Stop();
this.Play();
}
else if (!ParticleSystemEditorUtils.editorIsPlaying)
this.Play();
else
this.Pause();
current.Use();
}
else if (current.keyCode == (Event) ParticleEffectUI.kStop.keyCode)
{
this.Stop();
current.Use();
}
else if (current.keyCode == (Event) ParticleEffectUI.kReverse.keyCode)
num = -1;
else if (current.keyCode == (Event) ParticleEffectUI.kForward.keyCode)
num = 1;
if (num != 0)
{
ParticleSystemEditorUtils.editorIsScrubbing = true;
float editorSimulationSpeed = ParticleSystemEditorUtils.editorSimulationSpeed;
ParticleSystemEditorUtils.editorPlaybackTime = Mathf.Max(0.0f, ParticleSystemEditorUtils.editorPlaybackTime + (float) ((!current.shift ? 1.0 : 3.0) * (double) this.m_TimeHelper.deltaTime * (num <= 0 ? -3.0 : 3.0)) * editorSimulationSpeed);
if (root.isStopped)
{
root.Play();
root.Pause();
}
ParticleSystemEditorUtils.PerformCompleteResimulation();
current.Use();
}
}
if (current.type != EventType.KeyUp || current.keyCode != (Event) ParticleEffectUI.kReverse.keyCode && current.keyCode != (Event) ParticleEffectUI.kForward.keyCode)
return;
ParticleSystemEditorUtils.editorIsScrubbing = false;
}
示例12: PlayBackTimeGUI
internal void PlayBackTimeGUI(ParticleSystem root)
{
if (root == null)
{
root = ParticleSystemEditorUtils.GetRoot(this.m_SelectedParticleSystem);
}
EventType type = Event.current.type;
int hotControl = GUIUtility.hotControl;
string kFloatFieldFormatString = EditorGUI.kFloatFieldFormatString;
EditorGUI.BeginChangeCheck();
EditorGUI.kFloatFieldFormatString = s_Texts.secondsFloatFieldFormatString;
float a = EditorGUILayout.FloatField(s_Texts.previewTime, ParticleSystemEditorUtils.editorPlaybackTime, new GUILayoutOption[0]);
EditorGUI.kFloatFieldFormatString = kFloatFieldFormatString;
if (EditorGUI.EndChangeCheck())
{
if (type == EventType.MouseDrag)
{
ParticleSystemEditorUtils.editorIsScrubbing = true;
float editorSimulationSpeed = ParticleSystemEditorUtils.editorSimulationSpeed;
float editorPlaybackTime = ParticleSystemEditorUtils.editorPlaybackTime;
float num5 = a - editorPlaybackTime;
a = editorPlaybackTime + (num5 * (0.05f * editorSimulationSpeed));
}
ParticleSystemEditorUtils.editorPlaybackTime = Mathf.Max(a, 0f);
if (root.isStopped)
{
root.Play();
root.Pause();
}
ParticleSystemEditorUtils.PerformCompleteResimulation();
}
if ((type == EventType.MouseDown) && (GUIUtility.hotControl != hotControl))
{
this.m_IsDraggingTimeHotControlID = GUIUtility.hotControl;
ParticleSystemEditorUtils.editorIsScrubbing = true;
}
if ((this.m_IsDraggingTimeHotControlID != -1) && (GUIUtility.hotControl != this.m_IsDraggingTimeHotControlID))
{
this.m_IsDraggingTimeHotControlID = -1;
ParticleSystemEditorUtils.editorIsScrubbing = false;
}
EditorGUILayout.FloatField(s_Texts.particleCount, (float) this.m_SelectedParticleSystem.particleCount, new GUILayoutOption[0]);
int count = 0;
if (this.m_SelectedParticleSystem.CountSubEmitterParticles(ref count))
{
EditorGUILayout.FloatField(s_Texts.subEmitterParticleCount, (float) count, new GUILayoutOption[0]);
}
}
示例13: Start
void Start()
{
m_rgbd2d = GetComponent<Rigidbody2D>();
m_initialPosition = transform.position;
m_player = GameObject.FindGameObjectWithTag("Player");
m_characterRGBD = m_player.GetComponent<Rigidbody2D>();
m_BlockSound = GetComponent<AudioSource>();
m_BlockSound.loop = false;
if (gameObject.CompareTag("Destructible"))
{
m_animDestruct = GetComponentInChildren<Animator>();
m_animDestruct.enabled = false;
m_particleSystem = GetComponentInChildren<ParticleSystem>();
m_particleSystem.Pause();
m_boxColl = GetComponent<BoxCollider2D>();
}
}