Ejemplo n.º 1
0
    // Wakes up required external scripts
    private void Awake()
    {
        _rigidBody = GetComponent <Rigidbody2D>();
        _collider  = GetComponent <Collider2D>();
        _slideJump = GetComponent <PlayerWallJump>();

        //Calculates and stores jump force heigh based on physics gravity and jump strength, which can be defined in Unity Inspector
        _jumpForce = calculateJumpForce(Physics2D.gravity.magnitude, _jumpStrength);
    }
Ejemplo n.º 2
0
 // Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     pm = GetComponent <PlayerMovement>();
     if (GetComponent <PlayerWallJump>() != null)
     {
         pwj = GetComponent <PlayerWallJump>();
     }
     JumpKey = InputHandler.jump_key;
 }
Ejemplo n.º 3
0
    int[] masks            = new int[] { GROUND_LAYER, BLUE_LAYER, RED_LAYER, YELLOW_LAYER, GREEN_LAYER }; // 8, 9, 10, 11, 12

    // Start is called before the first frame update
    void Start()
    {
        IgnoreLayer = 0;
        colour      = Colour.Yellow;
        pm          = GetComponent <PlayerMovement>();
        if (GetComponent <PlayerWallJump>() != null)
        {
            pwj = GetComponent <PlayerWallJump>();
        }
    }
 //Cache currently used scripts to access as components
 private void Awake()
 {
     _movement    = GetComponent <PlayerMovement>();
     _jumping     = GetComponent <PlayerJump>();
     _slideJump   = GetComponent <PlayerWallJump>();
     _dash        = GetComponent <PlayerDash>();
     _attack      = GetComponent <PlayerAttack>();
     _groundPound = GetComponent <PlayerGroundPound>();
     _paintBomb   = GetComponent <PlayerPaintBomb>();
 }
Ejemplo n.º 5
0
 private void Awake()
 {
     animator          = GetComponent <Animator>();
     rb                = GetComponent <Rigidbody2D>();
     playerController  = GetComponent <PlayerController>();
     playerMovement    = GetComponent <PlayerMovement>();
     playerDash        = GetComponent <PlayerDash>();
     playerAttack      = GetComponent <PlayerAttack>();
     playerJump        = GetComponent <PlayerJump>();
     playerWallJump    = GetComponent <PlayerWallJump>();
     playerGroundPound = GetComponent <PlayerGroundPound>();
     playerPaintBomb   = GetComponent <PlayerPaintBomb>();
     death             = GetComponent <deathSystem>();
 }
Ejemplo n.º 6
0
 // Start is called before the first frame update
 void Start()
 {
     rb = GetComponent <Rigidbody2D>();
     pm = GetComponent <PlayerMovement>();
     if (GetComponent <PlayerWallJump>() != null)
     {
         pwj = GetComponent <PlayerWallJump>();
     }
     AirDashCounter  = 0;
     IsAirDashing    = false;
     IsGroundDashing = false;
     shaderGUItext   = Shader.Find("GUI/Text Shader"); // Shader for after-images when dashing
     DashKey         = InputHandler.dash_key;
     JumpKey         = InputHandler.jump_key;
 }