コード例 #1
0
 void Start()
 {
     player   = GameManager.Instance.playerGO;
     sr       = GetComponent <SpriteRenderer>();
     sr.color = new Vector4(0.5f, 0.5f, 0.5f, 1);
     rb       = GetComponent <Rigidbody2D>();
     rb.Sleep();
     anim         = GetComponent <Animator>();
     anim.enabled = false;
     Direction    = -1;
     isJumping    = new AnimatorTriggerBool(anim, "jump", false);
     isWalking    = new AnimatorTriggerBool(anim, "walk", false);
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: MyeonzinSon/PixelParts
 void Start()
 {
     GameManager.Instance.playerGO = gameObject;
     hp         = maxHP;
     sr         = GetComponent <SpriteRenderer>();
     anim       = GetComponent <Animator>();
     rb         = GetComponent <Rigidbody2D>();
     companions = new List <Companion>();
     isJumping  = new AnimatorTriggerBool(anim, "jump");
     isWalking  = new AnimatorTriggerBool(anim, "walk");
     if (weaponGO != null)
     {
         EquipWeapon(weaponGO);
     }
 }
コード例 #3
0
ファイル: Monster.cs プロジェクト: MyeonzinSon/PixelParts
 void Start()
 {
     player    = GameManager.Instance.playerGO;
     sr        = GetComponent <SpriteRenderer>();
     rb        = GetComponent <Rigidbody2D>();
     anim      = GetComponent <Animator>();
     Direction = -1;
     hp        = maxHP;
     isBoss    = GetComponent <BossAttack>() != null;
     if (isBoss)
     {
         isWalking = new AnimatorTriggerBool(anim, "walk", false);
         GetComponent <BossAttack>().StartPattern();
     }
     else
     {
         isJumping   = new AnimatorTriggerBool(anim, "jump", false);
         isAttacking = new AnimatorTriggerBool(anim, "attack", false);
     }
 }