当前位置: 首页>>代码示例>>C#>>正文


C# ParticleSystem.Pause方法代码示例

本文整理汇总了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 ();
    }
开发者ID:Sunghyo,项目名称:fashionstory,代码行数:29,代码来源:Sh.cs

示例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;
	}
开发者ID:EECS290-Spring14-Team8,项目名称:Y2K-Defend,代码行数:9,代码来源:FireWall.cs

示例3: charge

    public void charge(GameObject particles)
    {
        partSys = particles.GetComponent<ParticleSystem> ();

        if (currentBattery < maxBattery) {
            partSys.Pause ();
            isCharging = true;
        } else
            partSys.Clear ();
    }
开发者ID:seanmckeever16,项目名称:SeansGeniusLoci,代码行数:10,代码来源:PlayerBattery.cs

示例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> ();
    }
开发者ID:YuvalFeldman,项目名称:JetCat,代码行数:16,代码来源:Jump.cs

示例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();
    }
开发者ID:kvelury,项目名称:apocalyptia,代码行数:17,代码来源:RockfallScript.cs

示例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>();
    }
开发者ID:MatthewNelson2015,项目名称:UND-Capstone-Game-2014-2015,代码行数:16,代码来源:Torch.cs

示例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();
        }
开发者ID:ETGgames,项目名称:PlayMakerCustomActions_U4,代码行数:17,代码来源:ParticleSystemPause.cs

示例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;
			}
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:68,代码来源:ParticleEffectUI.cs

示例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;
			}
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:43,代码来源:ParticleEffectUI.cs

示例10: Start

 void Start()
 {
     ps = gameObject.GetComponentInChildren<ParticleSystem>();
     if (ps != null)
         ps.Pause();
 }
开发者ID:Crismis333,项目名称:MSU_TheSiege,代码行数:6,代码来源:ObstacleBehaviour.cs

示例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;
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:46,代码来源:ParticleEffectUI.cs

示例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]);
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:48,代码来源:ParticleEffectUI.cs

示例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>();
        }
    }
开发者ID:noctisyounis,项目名称:Playground2015_Project2,代码行数:18,代码来源:BlockBehaviour.cs


注:本文中的UnityEngine.ParticleSystem.Pause方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。