Esempio n. 1
0
        private void Awake()
        {
            state = StateType.Move;
            rb    = GetComponent <Rigidbody2D>();
            anim  = GetComponentInChildren <Animator>();
            anim.SetInteger("State", (int)AnimType.Stand);

            capCollider      = GetComponent <CapsuleCollider2D>();
            spRenderer       = GetComponentInChildren <SpriteRenderer>();
            suiyose          = GetComponent <Suiyose>();
            enemyInBlackhole = GetComponentInChildren <EnemyInBlackhole>();
            mapNameLayer     = LayerMask.NameToLayer("Map");
        }
Esempio n. 2
0
 void Awake()
 {
     instance = this;
     rb       = GetComponent <Rigidbody2D>();
     anim     = GetComponentInChildren <Animator>();
     anim.SetInteger("State", (int)AnimType.Idle);
     capsuleCollider2D         = GetComponent <CapsuleCollider2D>();
     spRenderer                = GetComponentInChildren <SpriteRenderer>();
     suiyose                   = GetComponent <Suiyose>();
     Energy                    = EnergyMax;
     contactFilter2D.layerMask = LayerMask.GetMask("Map");
     isEating                  = false;
     eatingCount               = 0;
     mouthOffsetRight          = transform.Find("MouthPosition").transform.localPosition;
     mouthOffsetLeft.Set(-mouthOffsetRight.x, mouthOffsetRight.y, 0);
     gameOverLayer = LayerMask.NameToLayer("GameOverPlayer");
     screenLeft.Set(0f, 0f, 1f);
 }