public void Break(BreakCause cause) { Instantiate(destroyFX, transform.position, Quaternion.identity) .GetComponent <CrateDestroy>() .Play(cause, transform.rotation); Destroy(gameObject); }
public void Play(BreakCause cause) { BreakParams bp = (cause == BreakCause.Melt) ? melting : breaking; animator.SetTrigger(bp.animationTrigger); sound.pitch = Random.Range(bp.pitchRange.x, bp.pitchRange.y); sound.clip = bp.sfx; sound.Play(); Destroy(gameObject, 5f); }
public void Break(BreakCause cause) { if (broken) { return; } broken = true; Instantiate(destroyFX, transform.position, transform.rotation) .GetComponent <DroneDestroy>() .Play(cause); Destroy(gameObject); }
public void Play(BreakCause cause, Quaternion spriteRot) { GetComponent <Animator>().SetTrigger(cause.ToString()); sprite.transform.rotation = spriteRot; Destroy(gameObject, 5f); }
public void Play(BreakCause cause) { GetComponent <Animator>().SetTrigger(cause.ToString()); Destroy(gameObject, 5f); }
public void Break(BreakCause cause = BreakCause.Break) { stateManager_.Swap(new StateBreak(this, cause)); }
public StateBreak(IcicleController ic, BreakCause cause = BreakCause.Break) : base(ic) { cause_ = cause; }