コード例 #1
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(this);
        }

        //Setting Ground box
        playerSize = GetComponent <BoxCollider2D>().size;
        boxSize    = new Vector2(playerSize.x - 0.03f, groundedSkin);
        rb         = GetComponent <Rigidbody2D>();
    }
コード例 #2
0
ファイル: PlayerAnimator.cs プロジェクト: SwishyD/Blink-Blade
 // Start is called before the first frame update
 void Start()
 {
     anim        = GetComponentInChildren <Animator>();
     pMoveScript = GetComponentInChildren <PlayerMovementV2>();
     pJumpScript = GetComponentInChildren <PlayerJumpV2>();
 }