private void Start() { throwclip = Resources.Load <AudioClip>("Audio/HatThrow"); throwSound = Addsound.AddAudio(throwclip, false, 0.55f, gameObject); throwclip2 = Resources.Load <AudioClip>("Audio/GhostShoot"); throwSound2 = Addsound.AddAudio(throwclip2, false, 1f, gameObject); }
public bool GetDamage(int amount, bool knockback, float DamageCooldown) { if (hCool >= Time.time) { return(false); } hCool = Time.time + DamageCooldown; SpriteRenderer sprite = gameObject.GetComponent <SpriteRenderer>(); StartCoroutine(DamageIndicator(sprite, DamageCooldown)); if (amount >= health) { ParticleSystem system = cwall.GetComponent <ParticleSystem>(); ParticleSystem.EmissionModule mod = system.emission; mod.enabled = true; Addsound.AddAudio(clip, false, 0.8f, cwall).Play(); StartCoroutine(PlayAndDestroy()); object_mesh.text = (int.Parse(object_mesh.text) - amount).ToString(); Instantiate(particles, PlayerPosition.position, Quaternion.identity); } else { object_mesh.text = (int.Parse(object_mesh.text) - amount).ToString(); health -= amount; } return(true); }
void Start() { clip = Resources.Load <AudioClip>("Audio/Fireball"); Debug.Log(clip); fireballsound = Addsound.AddAudio(clip, false, 0.8f, gameObject); rb = GetComponent <Rigidbody2D>(); rb.velocity = transform.right * speed; fireballsound.Play(); }
void Start() { clip = Resources.Load <AudioClip>("Audio/Enemydeath"); deathsound = Addsound.AddAudio(clip, false, 0.7f, gameObject); PlayerPosition = GetComponent <Transform>(); mesh = Instantiate(GameObject.FindGameObjectWithTag("Enemy_Health")); heart = Instantiate(GameObject.Find("enemy_heart")); object_mesh = mesh.GetComponent <TextMeshPro>(); object_mesh.text = health.ToString(); }
void Start() { bimpactclip = Resources.Load <AudioClip>("Audio/BadImpact"); goodclip = Resources.Load <AudioClip>("Audio/GhostHit"); badimpact = Addsound.AddAudio(bimpactclip, false, 1f, GameObject.FindGameObjectWithTag("Player")); goodimpact = Addsound.AddAudio(goodclip, false, 1f, GameObject.FindGameObjectWithTag("Player")); throwclass = FindObjectOfType <Throwing>(); rb = GetComponent <Rigidbody2D>(); rb.velocity = transform.right * speed; }
private void Start() { jumpclip = Resources.Load <AudioClip>("Audio/JS"); hitclip = Resources.Load <AudioClip>("Audio/oof"); jumpsound = Addsound.AddAudio(jumpclip, false, 0.8f, gameObject); hitSound = Addsound.AddAudio(hitclip, false, 0.8f, gameObject); DashEnabled = false; rb = GetComponent <Rigidbody2D>(); animatorss = GetComponent <Animator>(); Jumps = ExtraJumpCount; DefaultFall = fallMultiplierFloat; }