private void Awake() { controller = GetComponent <PlayerPlatformer>(); m_animator = GetComponent <Animator>(); m_rigidbody = GetComponent <Rigidbody2D>(); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.transform.CompareTag("Player")) { PlayerPlatformer player = collision.transform.GetComponent <PlayerPlatformer>(); if (player) { bounceSFX.Play(); player.SetBounceJump(1.6f); if (!super) { OnBounceEvent.Invoke(); } } } else if (collision.transform.CompareTag("Enemy")) { PlatformerCreature enemy = collision.transform.GetComponent <PlatformerCreature>(); if (enemy) { bounceSFX.Play(); if (collision.transform.position.y > transform.position.y + .1f) { OnBounceEvent.Invoke(); enemy.OnBouncyTopEvent(transform.position, super); } else { OnBounceEvent.Invoke(); enemy.OnBouncySideEvent(transform.position); } } } }
public virtual void OnTouchEvent(PlayerPlatformer player) { if (gameObject.activeSelf) { StartCoroutine(InteractionDelay(3)); } }
private void Awake() { instance = this; playerBase = gameObject.GetComponent <Player_Base>(); rigidbody2d = transform.GetComponent <Rigidbody2D>(); boxCollider2d = transform.GetComponent <BoxCollider2D>(); isDead = false; }
private void Awake() { shieldDirection = Directions.E; playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerPlatformer>(); canCompute = true; }
private void OnTriggerEnter2D(Collider2D collision) { playerscript = collision.GetComponent <PlayerPlatformer>(); playerscript.DestroyChildren(); playerscript.GetComponent <Rigidbody2D>().velocity = Vector2.zero; playerscript.GetComponent <Rigidbody2D>().simulated = false; playerscript.gravityModifier = 0; playerscript.animator.SetTrigger("Fall"); }
private void OnTriggerExit2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { playerScript.canHpUp = false; playerScript = null; } }
private void Awake() { controller = GetComponent <PlayerPlatformer>(); m_animator = GetComponent <Animator>(); m_rigidbody = GetComponent <Rigidbody2D>(); playerLayer = LayerMask.NameToLayer("Player"); platformLayer = LayerMask.NameToLayer("Platform"); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { PlayerPlatformer player = collision.GetComponent <PlayerPlatformer>(); if (player) { player.SetJump(1.5f); } } }
public override void OnTouchEvent(PlayerPlatformer player) { base.OnTouchEvent(player); switch (state) { case State.Idle: player.SetDamage(transform.position, 1); if (attackCoroutine != null) { StopCoroutine(attackCoroutine); } attackCoroutine = StartCoroutine(AttackState()); break; } }
public override void OnStompEvent(PlayerPlatformer player) { if (state == State.Stunned) { return; } base.OnStompEvent(player); player.SetEnemyJump(); if (stunCoroutine != null) { StopCoroutine(stunCoroutine); } stunCoroutine = StartCoroutine(StunState(5 * new Vector2((!player.facingRight ? -1 : 1), .6f), (int)(stunTime * 60), player.facingRight)); }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.CompareTag("Player")) { PlayerPlatformer playerscript = collision.gameObject.GetComponent <PlayerPlatformer>(); if (!playerscript.isBurning) { collision.gameObject.GetComponent <Rigidbody2D>().velocity = Vector2.up * rebound; playerscript.isBurning = true; playerscript.animator.SetBool("IsBurning", true); playerscript.StartCoroutine("ResetAddforce"); } else { Destroy(collision.transform.GetChild(0).gameObject); collision.gameObject.GetComponent <Animator>().SetTrigger("FireDeath"); } } }
public override void OnStompEvent(PlayerPlatformer player) { if (stunned) { return; } base.OnStompEvent(player); ResetValues(); if (state == State.Dizzy) { StopAllCoroutines(); } player.SetEnemyJump(); state = State.Idle; ResetValues(); StartCoroutine(StunState(5 * new Vector2((!player.facingRight ? -1 : 1), .6f), (int)(stunTime * 60), player.facingRight)); }
public virtual void OnTouchEvent(PlayerPlatformer player) { player.SetDamage(transform.position, 1); }
public virtual void OnStompEvent(PlayerPlatformer player) { player.SetEnemyJump(); Vanish(); }
public override void OnTouchEvent(PlayerPlatformer player) { base.OnTouchEvent(player); player.SetDamage(transform.position, 1); }
private void Awake() { playerScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerPlatformer>(); }
private void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerPlatformer>(); playerRb2d = player.GetComponent <Rigidbody2D>(); }