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


C# Timer.Restart方法代码示例

本文整理汇总了C#中Timer.Restart方法的典型用法代码示例。如果您正苦于以下问题:C# Timer.Restart方法的具体用法?C# Timer.Restart怎么用?C# Timer.Restart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Timer的用法示例。


在下文中一共展示了Timer.Restart方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Start

	void Start()
    {
        if (fade == null)
        {
            fade = transform.GetComponentInChildren<VignetteScript>();
        }
        fade.FadeIn();
        lifetime = new Timer(timeOnScreen + fade.fadeInTime, () => FadeOut());
        lifetime.Restart();

        if (getTotalScore)
        {
            int totalLosses = GameObject.FindGameObjectWithTag("Score").GetComponent<ScoreScript>().GetTotal();
            GetComponent<GUIText>().text = totalLosses.ToString();
            Application.ExternalCall("TotalLosses", totalLosses);
        }
        else
        {
            ScoreScript score = GameObject.FindGameObjectWithTag("Score").GetComponent<ScoreScript>();
            int losses = score.GetMostRecent();
            lossesText.text += score.GetMostRecent();
            levelCompleteText.text = levelCompleteText.text.Replace("{0}", score.CurrLevelNumber.ToString());
            //GetComponent<GUIText>().text = losses.ToString();
            Application.ExternalCall("LossesOnLevel", score.PreviousScene, losses);
        }
    }
开发者ID:envy3d,项目名称:TheFieldsV2,代码行数:26,代码来源:ScoreCardScript.cs

示例2: Start

 void Start()
 {
     if (fade == null)
     {
         fade = transform.GetComponentInChildren<VignetteScript>();
     }
     fade.FadeIn();
     lifetime = new Timer(fade.fadeInTime, () => AcceptInput());
     lifetime.Restart();
 }
开发者ID:envy3d,项目名称:TheFieldsV2,代码行数:10,代码来源:SwitchSceneOnInputScript.cs

示例3: Start

	void Start()
    {
        fadeTime = slideFadeOutTime;
		autoSlideTime = autoSlideDelay;
        if (fade == null)
        {
            fade = GetComponentInChildren<VignetteScript>();
        }

        fade.fadeInTime = forcedSceneFadeInTime;
        fade.FadeIn();

        delayTimer = new Timer(forcedSceneFadeInTime, () => ResetTimer());
        delayTimer.Restart();
	}
开发者ID:envy3d,项目名称:TheFieldsV2,代码行数:15,代码来源:TimedSlideshowScript.cs

示例4: Start

	void Start () {
        delayTimer = new Timer(delay, () => SpawnThing());
        delayTimer.Restart();
	}
开发者ID:envy3d,项目名称:TheFieldsV2,代码行数:4,代码来源:SpawnAfterDelayScript.cs

示例5: Start

    void Start()
    {
        CheckOffsets();

        //But I think you're just mad 'cause you're singleton.
        if (!instance) instance = this;
        else if (instance != this) Destroy(this);

        timer = Timer.instance;
        timer.setTimerStartValue(timerStartValue);
        timer.Restart ();
        timer.Pause();

        isStartScreen = true;

        score = Score.instance;

        screenSize = new Vector2 (Screen.width, Screen.height);
        screenSize = Camera.main.ScreenToWorldPoint (screenSize);

        FindAudioSources ();
        cam = GameObject.Find ("Main Camera").GetComponent<Camera>();

        shakeRate = initialShakeRate;
    }
开发者ID:GabrielRaposo,项目名称:TurnItProject,代码行数:25,代码来源:GameManager.cs

示例6: Start

 public override void Start()
 {
     base.Start();
     followerSpawn = new Timer();
     followerSpawn.Restart();
     AddFollower(this);
 }
开发者ID:Benedict-SC,项目名称:doom-dial,代码行数:7,代码来源:Chainer.cs

示例7: Start

 // Use this for initialization
 void Start()
 {
     SpriteRenderer sr = transform.gameObject.GetComponent<SpriteRenderer> ();
     float radius = sr.bounds.size.x / 2;
     CircleCollider2D collider = transform.gameObject.GetComponent<CircleCollider2D> ();
     collider.radius = radius;
     if (isSplitBullet)
     {
         collider.radius *= 2f;
     }
     collide2D = collider;
     //Debug.Log ("bullet radius is: " + radius);
     if (arcDmg > 0)
     {
         isActive = false;
         collider.enabled = false;
     }
     if (isSplitBullet)
     {
         splitPivot = Instantiate (Resources.Load ("Prefabs/SplitPivot")) as GameObject;
         splitPivot.transform.position = new Vector3(0f,0f,0f);
         splitPivot.transform.rotation = new Quaternion (0f,0f,0f,0f);
         transform.SetParent (splitPivot.transform, true);
         LERP_TIME_CONSTANT = .34f; //CONSTANT - time to travel across one lane
         lerpTime = splitCount * LERP_TIME_CONSTANT;
         Debug.Log ("lerpTime is " + lerpTime);
         //StartCoroutine("splitMovement");
         splitTimer = new Timer();
         timerElapsed = false;
         splitTimer.Restart ();
     }
     gameManager = GameObject.Find ("GameManager");
     if (gameManager == null)
     {
         Debug.Log ("zoneconecontroller couldn't find GameManager!");
     }
     waveMan = gameManager.GetComponent<WaveManager>();
 }
开发者ID:Benedict-SC,项目名称:doom-dial,代码行数:39,代码来源:BulletController.cs

示例8: Start

 public override void Start()
 {
     base.Start();
     partnerSpawn = new Timer();
     partnerSpawn.Restart();
     originalSpot = rt.anchoredPosition;
 }
开发者ID:Benedict-SC,项目名称:doom-dial,代码行数:7,代码来源:TipOfTheSpear.cs

示例9: Start

 public override void Start()
 {
     base.Start();
     partnerSpawn = new Timer();
     partnerSpawn.Restart();
     AddPartner(this);
 }
开发者ID:Benedict-SC,项目名称:doom-dial,代码行数:7,代码来源:MeatShield.cs


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