public void setup(Hurt hurt) { this.hurt = hurt; hurt.onDeath.AddListener(() => { dead = true; }); }
// Use this for initialization void Start() { controller = GetComponent <PlayerController> (); animator = GetComponent <Animator> (); hurt = GetComponent <Hurt> (); collectedB = 0; collectedY = 0; }
void Start() { rbody = GetComponent <Rigidbody2D>(); player = GameObject.Find("Player").GetComponent <Rigidbody2D>(); eDomain = GameObject.Find("EDomain"); zoneScript = eDomain.GetComponent <EnemyTriggerZone> (); hurtE = GetComponent <Hurt> (); updateDistances(); }
private void Start() { pause.enabled = false; victory.enabled = false; deathScreen.enabled = false; hint.enabled = false; player_ = GameObject.FindGameObjectWithTag("Player").GetComponent <Hurt>(); audioSource_ = GameObject.FindGameObjectWithTag("Music").GetComponent <AudioSource>(); }
void OnTriggerEnter2D(Collider2D other) { Hurt target = other.GetComponent <Hurt>(); if (target != null) { manager.CharacterDestroyed(); this.transform.SetPositionAndRotation(new Vector3(-3.07f, -0.994f, 0), other.transform.rotation); } }
private void Awake() { rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); sr = GetComponent <SpriteRenderer>(); mySource = GetComponent <AudioSource>(); fsm = new FSM(); moveState = new Move(this, WalkSpeed); hurtState = new Hurt(this, TimeHurt); jumpState = new Jump(this, JumpForce, rb); jumpState.SetMaxJumps(JumpCount); stuckState = new Stuck(this, TimeStuck, VulnerableArea); idleState = new Idle(this, 3.0f); deadState = new Dead(); }
// Use this for initialization void Start() { hurt = this; }
internal static void InvokeHurt(object player, object damageSource, int damage, bool isPvP, bool isCritical) { Hurt?.Invoke(null, new HurtEventArgs((Player)player, (PlayerDeathReason)damageSource, damage, isPvP, isCritical)); }
public void Oof() { Hurt?.Invoke(); }