//passing null sprite because mario's states control his sprite public Mario(Vector2 position) : base(null, position, Color.Yellow) { Spawns = new List <Vector2>(); Spawns.Add(new Vector2(position.X, position.Y)); ActiveSpawn = Spawns[0]; HasAirDash = true; Orientation = Facing.Right; Gravity = true; BounceCount = 0; Lives = 3; CoinCount = 0; Winner = true; LevelCompleted = false; StateMachine = new MarioStateMachine(this); StateMachine.Begin(); _FireBallPool = new FireballPool(2); BoundingBox.UpdateHitBox(position, Sprite); EventManager.Instance.RaisePowerupCollectedEvent += ReceivePowerup; }
private void Start() { _fireballPool = FindObjectOfType <FireballPool>(); voiceOverAudioSource = _fireballPool.voiceOverObj.GetComponent <AudioSource>(); }
void Awake() { hitboxManager = GetComponent <HitboxManager>(); spriteRenderer = GetComponent <SpriteRenderer>(); fireballPool = FindObjectOfType <FireballPool>(); }
//Basic singleton implementation private void Awake() { Instance = this; }
void Awake() { fireballPool = FindObjectOfType <FireballPool>(); }
private new void Start() { base.Start(); _fireballPool = FindObjectOfType <FireballPool>(); }