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;
 }
示例#2
0
 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);
 }
示例#4
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);
 }
示例#5
0
 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);
 }
示例#7
0
 void GetWeakPoint()
 {
     weakPoint = (WeakPoint)Getter.ComponentInChild(this, gameObject, typeof(WeakPoint), 0);
 }