public void SetState(StarState state) { switch (state) { case StarState.DEFAULT: neighborIndicator.SetActive(false); isNeighbour = false; playerLocationIndicator.SetActive(false); break; case StarState.VISITED: GetComponentInChildren <SpriteRenderer>().color = visitedColor; break; case StarState.PLAYER_POSITION: playerLocationIndicator.SetActive(true); break; case StarState.NEIGHBOUR: neighborIndicator.SetActive(true); isNeighbour = true; break; default: break; } }
public static void PushState(StarState state, bool start = true) { States.Push(state); state.InitState(); state.Running = true; state.StartState(); }
public override void Update() { if (CurStarState == StarState.Expanding) { CurScale.X = UtilityGlobals.Clamp(CurScale.X + ScaleRate, 0f, MaxScale.X); CurScale.Y = UtilityGlobals.Clamp(CurScale.Y + ScaleRate, 0f, MaxScale.Y); if (CurScale == MaxScale) { CurStarState = StarState.Waiting; } } else if (CurStarState == StarState.Waiting) { //Increment time and check if it should start shrinking ElapsedTime += Time.ElapsedMilliseconds; if (ElapsedTime >= DisplayTime) { CurStarState = StarState.Shrinking; } } else { //Shrink the star CurScale.X = UtilityGlobals.Clamp(CurScale.X - ScaleRate, 0f, MaxScale.X); CurScale.Y = UtilityGlobals.Clamp(CurScale.Y - ScaleRate, 0f, MaxScale.Y); if (CurScale == Vector2.Zero) { ReadyForRemoval = true; } } }
public void VomitStar(Vector3 position) { if (m_State != StarState.InBody) { return; } m_State = StarState.Idle; owner = null; }
public void StarTransition(Peach peach) { sound = peach.Content.Load <SoundEffect>("Sound Effects/Power Up"); sound.Play(); var state = new StarState(this); peach.PowerUpState = state; peach.SwitchToStarSprite(); }
public void SetChosen() { state = GlobalDefines.StarState.Chosen; //change sprite to blue starSprite.spriteName = blueStarPath; starSprite.MakePixelPerfect(); //stop shine shineLogic.StopShine(); }
virtual public void SetSuccess() { state = StarState.Success; if (legionData == null) { War.starManager.getPanel.Open(starConfig); } }
/// <summary> /// 玩家吃星星 /// </summary> /// <param name="player">The player.</param> /// <param name="star">The star.</param> public void EatStar(GameObject player) { if (m_State == StarState.InBody) { return; } owner = player.gameObject; target = null; m_State = StarState.InBody; gameObject.SetActive(false); }
public void SetLinked() { state = GlobalDefines.StarState.Linked; //change sprite to yellow starSprite.spriteName = yellowStarPath; starSprite.MakePixelPerfect(); //start to shine shineSprite.spriteName = yellowStarPath; shineSprite.MakePixelPerfect(); shineLogic.StartShine(); }
public void SetNormal() { state = StarState.Normal; //change sprite to yellow starSprite.spriteName = yellowStarPath; starSprite.MakePixelPerfect(); //start to shine shineSprite.spriteName = yellowStarPath; shineSprite.MakePixelPerfect(); shineLogic.StartShine(); }
public StarStateChangedEventArgs(StarState current) { if (current == StarState.On) { this.OldState = StarState.Off; this.NewState = StarState.On; } else { this.OldState = StarState.On; this.NewState = StarState.Off; } }
/// <summary> /// 玩家吐星星 /// </summary> public void VomitStar(GameObject target) { if (m_State != StarState.InBody) { return; } gameObject.SetActive(true); this.target = target.transform; Vector3 moveDir = (target.transform.position - owner.transform.position).normalized; transform.position = owner.transform.position + moveDir * 0.5f; m_State = StarState.Flying; owner = null; }
private static void OnStateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { Star star = obj as Star; if (star != null) { StarState newState = (StarState)e.NewValue; //// set the fill based on the state star.StarFill = (newState == StarState.On) ? star.OnColor : star.OffColor; //// raise state change event star.OnStateChanged(new StarStateChangedEventArgs(star.State)); } }
public BasicMachine(Character character) : base(character) { // States StarState star = new StarState(character); EvadeState evade = new EvadeState(character); DeadState die = new DeadState(character); ChaseLifeState chase = new ChaseLifeState(character); // Add states this.states.Add(star); this.states.Add(evade); this.states.Add(die); this.states.Add(chase); this.initialState = this.currentState = star; }
public void SetState(StarState state) { this.starstate = state; switch (this.starstate) { case StarState.On: star.Frequency = 0.1f; star.Magnitude = 0.2f * velocity; star.Speed = 5; break; case StarState.Off: star.Frequency = 0f; star.Magnitude = 0f * velocity; star.Speed = 0; break; } }
private static void OnStateChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { Star star = obj as Star; if (star != null) { StarState newState = (StarState)e.NewValue; if (newState == StarState.Off) { star.OffStar.Visibility = Visibility.Visible; star.OnStar.Visibility = Visibility.Collapsed; } else { star.OffStar.Visibility = Visibility.Collapsed; star.OnStar.Visibility = Visibility.Visible; } } }
public Terminal Repeat(Range r) { IAutomaton seq = DFA.EmptyState.Instance; for (int i = 0; i < r.Start.Value; ++i) { seq = DFA.SeqState.Create(automaton, seq); } if (r.End.IsFromEnd) { seq = DFA.SeqState.Create(seq, StarState.Create(automaton)); } else { for (int i = r.Start.Value; i < r.End.Value; ++i) { seq = DFA.SeqState.Create(seq, DFA.OrState.Create(DFA.EmptyState.Instance, automaton)); } } return(new Terminal(seq)); }
private void Start() { m_State = StarState.Idle; }