private void Update() { if (Hp <= 0f) { Destroy(gameObject); } position = transform.position; position = new Vector3(transform.position.x, transform.position.y + 1f); if (start == true) { timer++; if (timer == 110) { State = CharState_Mob_1.run; timer = 0; start = false; flag = false; edcol.enabled = true; } } }
private void OnTriggerEnter2D(Collider2D collider) { pairos pairos = collider.GetComponent <pairos>(); Fly_kik Fly_kik = collider.GetComponent <Fly_kik>(); unit unit = collider.GetComponent <unit>(); if (unit && unit is player && !Fly_kik && !flag) { edcol.enabled = false; flag = true; State = CharState_Mob_1.Ataka; start = true; } if (pairos) { ResivDameg(); } if (Fly_kik) { ResivDameg(); GG = Fly_kik; } }