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


C# Circle.GetReactionTimeMs方法代码示例

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


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

示例1: OnCircleDeactivatedHandler

    private static void OnCircleDeactivatedHandler(Circle sender, CircleDeactivatedEventArgs args)
	{
		GainedScore += args.GainedPoints;

		if (Stages.CurrentStage.IsLastLevel()){
			temporaryUnavailable.circles.Remove (sender);
		} else {			
			temporaryUnavailable.Push (sender);
		}

        if (args.GainedPoints < 1 || tapsLeft <= 1)
        {
            gameOver = true;
            foreach (var circle in circles)
            {
                circle.OnCircleDeactivated -= OnCircleDeactivatedHandler;
                circle.SetToWhiteAndDisable(); 
            } 

            if (tapsLeft <= 1)
            {
                IsLevelSuccesful = true;
            }

            if (args.GainedPoints <= 0)
            {
                IsLevelSuccesful = false;
            }

            if (args.TappedOutside)
            {
				DateTime time = DateTime.Now;
                var ac = Resources.Load("BuzzerSFX") as AudioClip;
                AudioSource.PlayClipAtPoint(ac, Vector3.zero, 0.7f);

                self.Background.MakeItRed();

                self.StartCoroutine(self.GameOverAfter(1.25f));
                self.Background.box.enabled = false;


                foreach(var it in circles)
                {
                    it.CircleCol.enabled = false;
				} 
				Debug.Log ("before end of level time_:::" + (DateTime.Now - time).TotalMilliseconds);
            }
            else
			{
				DateTime time = DateTime.Now;
                tapsLeft--;
				self.StartCoroutine(self.GameOverAfter(0.2f));
				Debug.Log ("before end of level time_:::" + (DateTime.Now - time).TotalMilliseconds);
            }
        }
        else
        {
            if ( (Time.time - LastTapTime) < kDoubleTapTreshold)
            {
                // showing the bonus  
                LastTapTime = -10;
                Bonus.OnDoubletapped(args.GainedPoints);
            }
            else
            { 
                LastTapTime = Time.time;
                clickTimeVec.Add(sender.GetReactionTimeMs());
            }
            
            tapsLeft--;
        }

        bool clear = circles.Where(circle => circle.IsActivated).Count() == 0;
        if (clear && !gameOver && Stages.CurrentStage.IsLastLevel())
        {
            self.StartCoroutine(self.ActivateAllTheCirlesDelayed(0.2f));
        }

        lastGained = args.GainedPoints;
    }
开发者ID:JulianPaul,项目名称:WhackBash,代码行数:80,代码来源:GameController.cs


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