public void Awake()
 {
     sensor            = GetComponent <PlayerCollisionSensor>();
     rb                = GetComponent <Rigidbody2D>();
     realisticMovement = GetComponent <RealisticMovement>();
     mainframeMovement = GetComponent <MainframeMovement>();
     liveWireMovement  = GetComponent <LiveWireMovement>();
     DeactivateAllModes();
     if (activeMovementMode == null)
     {
         activeMovementMode = mainframeMovement;
         mainframeMovement.Activate();
     }
 }
Beispiel #2
0
        // Start is called before the first frame update
        public virtual void Start()
        {
            transform.position = GameManager.Instance.transitions.getSpawnPosition();
            isFacingRight      = GameManager.Instance.transitions.getSpawningRight();
            anim = GetComponent <Animator>();
            anim.SetBool("IsFacingRight", isFacingRight);

            jumpForce         = new Vector2(0, jump);
            maxSqrVelocity    = maxVelocity * maxVelocity;
            rb                = GetComponent <Rigidbody2D>();
            rb.freezeRotation = true;

            sensor      = GetComponent <PlayerCollisionSensor>();
            boxCollider = GetComponent <BoxCollider2D>();
        }