void Awake() { if (instance == null) { instance = this; } }
void Start() { animatorSpawner = AnimatorSpawner.instance; audioManager = AudioManager.instance; rb = GetComponent <Rigidbody2D>(); trans = GetComponent <Transform>(); anim = GetComponent <Animator>(); boxCollider = GetComponent <BoxCollider2D>(); ledgeCollider = trans.GetChild(0).gameObject; canMove = true; isGrounded = true; flip = true; isBasicPlayer = true; isSecondTypePlayer = false; isThirdTypePlayer = false; canMoveLeft = true; canMoveRight = true; ledgeDetection = true; healthBar.SetMaxHealth(maxHealthPoints); currentHealth = maxHealthPoints; }