Example #1
0
 void Start()
 {
     player              = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>();
     playerController    = GetComponent <playerController>();
     playerGroundedCheck = player.GetComponentInChildren <PlayerGroundedCheck>();
     playerAnimator      = player.GetComponent <Animator>();
 }
 // Start is called before the first frame update
 void Start()
 {
     playerGroundedCheck = GetComponentInChildren <PlayerGroundedCheck>();
     playerTransform     = GetComponent <Transform>();
     player         = GetComponent <Rigidbody2D>();
     playerCollider = GetComponent <CapsuleCollider2D>();
     playerAttack   = GetComponent <playerAttack>();
 }
 // Start is called before the first frame update
 void Start()
 {
     playerGroundedCheck = GetComponentInChildren <PlayerGroundedCheck>();
     playerTransform     = GetComponent <Transform>();
     player         = GetComponent <Rigidbody2D>();
     playerCollider = GetComponent <CapsuleCollider2D>();
     playerAttack   = GetComponent <playerAttack>();
     UI             = FindObjectOfType <Canvas>();
     healthBar      = UI.GetComponentInChildren <PlayerHealthBar>();
 }
    void Start()
    {
        playerSprite        = GetComponent <SpriteRenderer>();
        playerGroundedCheck = GetComponentInChildren <PlayerGroundedCheck>();
        playerTransform     = GetComponent <Transform>();
        player         = GetComponent <Rigidbody2D>();
        playerCollider = GetComponent <CapsuleCollider2D>();
        playerAttack   = GetComponent <playerAttack>();
        UI             = FindObjectOfType <Canvas>();
        //healthBar = UI.GetComponentInChildren<PlayerHealthBar>();
        primaryAttackPoint = transform.Find("primaryAttackPoint");
        subAttackPoint     = transform.Find("subAttackPoint");
        playerAnimator     = GetComponent <Animator>();

        /*playerHealth = 16;
         * playerFacing = 1;
         * isInvulnerable = false;
         * invulnerableDuration = 3;
         * jumpForce = 7.5f;
         * isHit = false;
         * isDead = false;
         * speed = 5f;
         * nearStairs = false;
         * onStairs = false;
         * goingUp = false;
         * goingDown = false;
         * stairsStartPoint = Vector2.zero;
         * stairsEndPoint = Vector2.zero;
         * nearbyStairs = null;
         * stairsInfo = null;
         * stairsFacing = 0;
         * stairsSlope = 0;
         * maxVelocity = 5f;
         * stepRate = 4f;
         */
    }
Example #5
0
 void Start()
 {
     playerGroundedCheck = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <PlayerGroundedCheck>();
     player = GameObject.FindGameObjectWithTag("Player").GetComponent <Rigidbody2D>();
 }