本文整理汇总了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);
}
}
示例2: Start
void Start()
{
if (fade == null)
{
fade = transform.GetComponentInChildren<VignetteScript>();
}
fade.FadeIn();
lifetime = new Timer(fade.fadeInTime, () => AcceptInput());
lifetime.Restart();
}
示例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();
}
示例4: Start
void Start () {
delayTimer = new Timer(delay, () => SpawnThing());
delayTimer.Restart();
}
示例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;
}
示例6: Start
public override void Start()
{
base.Start();
followerSpawn = new Timer();
followerSpawn.Restart();
AddFollower(this);
}
示例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>();
}
示例8: Start
public override void Start()
{
base.Start();
partnerSpawn = new Timer();
partnerSpawn.Restart();
originalSpot = rt.anchoredPosition;
}
示例9: Start
public override void Start()
{
base.Start();
partnerSpawn = new Timer();
partnerSpawn.Restart();
AddPartner(this);
}