Ejemplo n.º 1
0
    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;
        }
    }
Ejemplo n.º 2
0
 private void Awake()
 {
     _rigidbody     = GetComponent <Rigidbody2D>();
     _jumpHandler   = GetComponent <JumpHandler>();
     _groundChecker = GetComponent <GroundChecker>();
     _flipChecker   = GetComponent <FlipChecker>();
     robotAnimator  = animationRenderer.GetComponent <Animator>();
 }
    // Start is called before the first frame update
    void Start()
    {
//      state = GetComponent<CharacterState>();
        jump = GetComponent <JumpHandler>();
        walk = GetComponent <WalkHandler>();
    }
 public NavigationHandler(JumpHandler jumpHandler)
 {
     _jumpHandler = jumpHandler;
 }