コード例 #1
0
ファイル: PlatformObject.cs プロジェクト: GretelF/squircle
 public PlatformObject(Game game)
     : base(game)
 {
     State = new State();
     Waypoints = new Vector2[2];
     _targetIndex = new RingIndex()
     {
         Value = 0,
         LowerBound = 0,
         UpperBound = Waypoints.Length - 1
     };
     Faders = new PlatformFader[4];
     FadeTime = 0.2f;
     Faders[0] = dt => { /* Do nothing.*/ };
     Faders[1] = dt => // Fading in
     {
         CurrentFadeTime += (float)dt.ElapsedGameTime.TotalSeconds;
         if (CurrentFadeTime > FadeTime)
         {
             CurrentFadeTime = FadeTime;
     //                    Body.SetActive(true);
             DisableFading();
         }
     };
     Faders[2] = dt => // Fading out
     {
         CurrentFadeTime -= (float)dt.ElapsedGameTime.TotalSeconds;
         if (CurrentFadeTime < 0.0f)
         {
             CurrentFadeTime = 0.0f;
             DisableFading();
         }
     };
 }
コード例 #2
0
ファイル: TriggerObjects.cs プロジェクト: GretelF/squircle
 public ButtonObjectBase(Game game)
     : base(game)
 {
     InitialOnOffState = new State();
     OnOffState = new State();
     PressedState = new State() { Value = StateType.Inactive };
     DrawOrder = 20;
 }