// Start is called before the first frame update public override void Enter(GhostStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { //base.Enter(stateInput, transitionInfo); stateInput.anim.Play("Enemy_Move"); stateInput.rb.velocity = new Vector2(-stateInput.ghost.maxSpeed, 0f); targetedWaypoint = stateInput.ghost.waypoint_l; }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { //stateInput.canDash = false; //stateInput.playerController.dashing = true; dashTimer = stateInput.playerController.dashTime; stateInput.playerController.canDash = false; }
public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.crushroomManager = stateInput.crushroom.GetComponent <CrushroomManager>(); stateInput.crushroom.GetComponent <Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic; stateInput.crushroom.GetComponent <Rigidbody2D>().gravityScale = 2f; falling = true; }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { dashTimer = stateInput.playerController.dashTime; dir = stateInput.player.transform.rotation.eulerAngles.y == 180 ? -1 : 1; stateInput.anim.Play("Player_Dash"); EventManager.TriggerEvent <PlayerDashEvent, Vector3>(stateInput.player.transform.position); }
override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null) { input.slowSprite.enabled = false; travelOrigin = character.transform.position; //Make sure we don't teleport out of the map RaycastHit2D hit = Physics2D.Raycast(travelOrigin, input.cc.LastDirection, input.maxTravelDistance, LayerMask.GetMask("Arena")); float travelDistance = hit.collider ? (hit.distance - input.cc2d.radius) : input.maxTravelDistance; if (InputMap.Instance.GetInput(0, ActionType.RIGHT) || InputMap.Instance.GetInput(0, ActionType.LEFT) || InputMap.Instance.GetInput(0, ActionType.UP) || InputMap.Instance.GetInput(0, ActionType.DOWN)) { travelDestination = travelOrigin + input.cc.LastDirection * travelDistance; } else { travelDestination = travelOrigin; } //travelDestination = travelOrigin + input.cc.LastDirection * travelDistance; travelTime = travelDistance / input.maxTravelDistance * input.maxTravelTime; travelTimer = travelTime; state = Sequence.ENTER_HOLE; input.anim.Play("EnterHole"); AudioManager.instance.Play("SeleneTeleportEnter"); }
public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.crushroomManager = stateInput.crushroom.GetComponent <CrushroomManager>(); originalY = stateInput.crushroomManager.GetOriginalY(); stateInput.anim.SetBool("landed", false); stateInput.anim.Play("crushroom_retreat"); }
/// This can be called by any of this character's states in order to transition to a new one. /// The optional transition info provided is passed to the new state when it is Enter()-ed. public void ChangeState <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S { state?.ForceCleanUp(input); state = stateMap[typeof(N)]; softTransitionChangeState = null; state.Enter(input, transitionInfo); }
// bosses have a sleep state that gets switched to idle when the player triggers their associated area public override void Enter(MajorStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { base.Enter(stateInput, transitionInfo); stateInput.anim.Play("major_sleep"); stateInput.enemyController.EnemyPause(1f); stateInput.enemyController.isAwake = false; }
/// This can be called by any of this character's states in order to transition to a new one. /// The optional transition info provided is passed to the new state when it is Enter()-ed. public void ChangeState <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S { state?.ForceCleanUp(input); state = stateMap[typeof(N)]; softTransitionChangeState = null; stateChanged.Value = true; info = transitionInfo; }
override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null) { direction = input.cc.LastDirection.normalized; travelTimer = input.dashDuration; dashSpeed = input.dashSpeed; input.anim.Play("Dash"); }
public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.crushroomManager = stateInput.crushroom.GetComponent <CrushroomManager>(); stateInput.rb.bodyType = RigidbodyType2D.Dynamic; stateInput.rb.gravityScale = 2f; stateInput.rb.collisionDetectionMode = CollisionDetectionMode2D.Continuous; stateInput.anim.Play("crushroom_attack"); falling = true; }
public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { // base.Enter(stateInput, transitionInfo); // stateInput.anim.Play("Enemy_Idle"); width = stateInput.crushroom.GetComponent <SpriteRenderer>().bounds.size.x; leftX = stateInput.crushroom.transform.position.x - (width / 2); rightX = stateInput.crushroom.transform.position.x + (width / 2); }
override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null) { input.slowSprite.enabled = false; direction = input.cc.LastDirection.normalized; travelTimer = input.dashDuration; dashSpeed = input.dashSpeed; AudioManager.instance.Play("RheaDash"); input.anim.Play("Dash"); }
/// This can be called by any of this character's states in order to transition to a new one. /// The optional transition info provided is passed to the new state when it is Enter()-ed. public void ChangeState <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S { if (state != null) { state.ForceCleanUp(stateInput); } state = stateMap[typeof(N)]; //gets the numerical representation of the State you put in, then uses that as a key to get the actual instantiated state we put into the statemap before softTransitionChangeState = null; stateChanged.Value = true; info = transitionInfo; }
public override void Enter(MajorStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { base.Enter(stateInput, transitionInfo); stateInput.anim.Play("major_run"); if (stateInput.enemyController.facingRight) { stateInput.rb.velocity = new Vector2(stateInput.major_inconvenience.moveSpeed, 0); } else { stateInput.rb.velocity = new Vector2(-stateInput.major_inconvenience.moveSpeed, 0); } }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { if (transitionInfo == null) { timer = launchTime; } else { LaunchStateTransitionInfo launchTransition = (LaunchStateTransitionInfo)transitionInfo; timer = launchTransition.moveAfterLaunchTime; stateInput.playerController.launchPlayer(launchTransition.launchVelocity); stateInput.playerController.SetPlayerImmunity(launchTransition.invincible); } //stateInput.anim.Play("Player_Jump"); }
override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null) { travelOrigin = character.transform.position; //Make sure we don't teleport out of the map RaycastHit2D hit = Physics2D.Raycast(travelOrigin, input.cc.LastDirection, input.maxTravelDistance, LayerMask.GetMask("Arena")); float travelDistance = hit.collider ? (hit.distance - input.cc2d.radius) : input.maxTravelDistance; travelDestination = travelOrigin + input.cc.LastDirection * travelDistance; travelTime = travelDistance / input.maxTravelDistance * input.maxTravelTime; travelTimer = travelTime; state = Sequence.ENTER_HOLE; input.anim.Play("EnterHole"); }
override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null) { input.anim.Play("Cast"); }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { dashTimer = stateInput.playerController.dashTime; stateInput.anim.Play("Player_Dash"); }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.lastXDir = 0; stateInput.anim.Play("Player_Idle"); }
public override void Enter(MinorStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { base.Enter(stateInput, transitionInfo); // stateInput.anim.Play("Enemy_Idle"); }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { timer = launchTime; //stateInput.anim.Play("Player_Jump"); }
override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null) { shield = UnityEngine.Object.Instantiate(input.shieldPrefab, character.transform); }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.lastXDir = 0; stateInput.playerController.canDash = true; //stateInput.anim.Play("Player_Idle"); }
/// Gives the current state a gentle warning that it should transition as soon as possible to the given state N public void ChangeStateSoft <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S { softTransitionChangeState = () => ChangeState <N>(transitionInfo); state.SoftTransitionWarning(stateInput); }
override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null) { this.transitionInfo = (ForceMoveTransitionInfo)transitionInfo; travelOrigin = character.transform.position; travelTimer = this.transitionInfo.moveTime; }
override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null) { input.anim.Play("Cast"); AudioManager.instance.Play("RheaSpellCasting1"); }
public override void Enter(BeemonStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.anim.Play("Enemy_Move"); stateInput.rb.velocity = new Vector2(-stateInput.beemon.maxSpeed, 0f); }
public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null) { stateInput.anim.Play("Player_Fall"); }
override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null) { shield = UnityEngine.Object.Instantiate(input.shieldPrefab, character.transform); AudioManager.instance.Play("RheaIntrinsicShield"); }