void Start() { #region variables declared speed = 7f; movement = 0f; #endregion #region Getting components SRender = GetComponent <SpriteRenderer>(); myHP = GetComponent <PlayerHealth>(); rigid = GetComponent <Rigidbody2D>(); scenes = GetComponent <LevelColl>(); mcoll = GetComponent <Collider2D>(); stats = GetComponent <Stats>(); hang = GetComponent <Hanging>(); #endregion #region Level System LevelSystem levelSystem = new LevelSystem(); #endregion DontDestroyOnLoad(this.gameObject); inventory = new Inventory(); }
private void Awake() { playerRoar = GetComponent <PlayerRoar>(); playerHealth = GetComponent <PlayerHealth>(); playerMovement = GetComponent <PlayerMovement>(); hanging = GetComponent <Hanging>(); anim = GetComponent <Animator>(); rb2d = GetComponent <Rigidbody2D>(); idle(); }