void KillAnimation() { AudioManager.Instance.PlaySoundOnce(caller: this, sound: deathAudioSource); animator.speed = 0; rb.velocity = Vector2.zero; (Getter.Component(this, gameObject, typeof(Collider2D)) as Collider2D).isTrigger = true; (Getter.ComponentInChild(this, gameObject, typeof(CircleCollider2D), 0) as CircleCollider2D).isTrigger = true; spriteRenderer.sortingOrder = (int)Layers.OrdersInDefaultLayer.Max; rb.AddForce(new Vector2(0, 100)); rb.gravityScale = Transforms.Gravity.Hard; }
void GetAudioSources() { timeOutAudioSource = (AudioSource)Getter.ComponentInChild(this, gameObject, typeof(AudioSource), 0); backgroundMusic = (AudioSource)Getter.ComponentInChild(this, gameObject, typeof(AudioSource), 1); }
override protected void Awake() { base.Awake(); deathAudioSource = (AudioSource)Getter.ComponentInChild(this, gameObject, typeof(AudioSource), 0); }
void GetHelpers() { bottomColliderHelper = (PopColliderHelper)Getter.ComponentInChild(this, gameObject, typeof(PopColliderHelper), 0); rightColliderHelper = (PopColliderHelper)Getter.ComponentInChild(this, gameObject, typeof(PopColliderHelper), 1); leftColliderHelper = (PopColliderHelper)Getter.ComponentInChild(this, gameObject, typeof(PopColliderHelper), 2); }
void GetAudioSources() { jumpAudioSource = (AudioSource)Getter.ComponentInChild(this, gameObject, typeof(AudioSource), 0); winAudioSource = (AudioSource)Getter.ComponentInChild(this, gameObject, typeof(AudioSource), 1); deathAudioSource = (AudioSource)Getter.ComponentInChild(this, gameObject, typeof(AudioSource), 2); }
void GetComponents() { rb = (Rigidbody2D)Getter.Component(this, gameObject, typeof(Rigidbody2D)); animator = (Animator)Getter.Component(this, gameObject, typeof(Animator)); spriteRenderer = (SpriteRenderer)Getter.ComponentInChild(this, gameObject, typeof(SpriteRenderer), 0); }
void GetWeakPoint() { weakPoint = (WeakPoint)Getter.ComponentInChild(this, gameObject, typeof(WeakPoint), 0); }