コード例 #1
0
ファイル: Player.cs プロジェクト: IrmaLerrr/game-cyberpank
    protected override void Start()
    {
        base.Start();

        //spriteRenderer = GetComponent<SpriteRenderer>();
        animator      = GetComponent <Animator>();
        rb            = GetComponent <Rigidbody2D>();
        jumpHandler   = GetComponent <JumpHandler>();
        robotAnimator = animationRenderer.GetComponent <Animator>();

        foreach (Robot robot in (new Robot[] { attackRobot, agilityRobot, tankRobot }))
        {
            robots.Add(robot.GetRobotID(), robot);
            robot.gameObject.SetActive(false);
            robot.SetColliderProperties();
        }

        currentRobot = attackRobot;
        currentRobot.gameObject.SetActive(true);
        SetAnimatorToRobot(currentRobot);

        if (!facingRight)
        {
            invert = -1;
        }
        else
        {
            invert = 1;
        }
    }
コード例 #2
0
 private void Awake()
 {
     _rigidbody     = GetComponent <Rigidbody2D>();
     _jumpHandler   = GetComponent <JumpHandler>();
     _groundChecker = GetComponent <GroundChecker>();
     _flipChecker   = GetComponent <FlipChecker>();
     robotAnimator  = animationRenderer.GetComponent <Animator>();
 }
コード例 #3
0
    // Start is called before the first frame update
    void Start()
    {
//      state = GetComponent<CharacterState>();
        jump = GetComponent <JumpHandler>();
        walk = GetComponent <WalkHandler>();
    }
コード例 #4
0
 public NavigationHandler(JumpHandler jumpHandler)
 {
     _jumpHandler = jumpHandler;
 }