Exemplo n.º 1
0
        /// <summary>
        /// Subscribes to events and initializes other variables.
        /// </summary>
        public Entity()
        {
            Sounds = new SoundFxManager(this);

            // Subscribes to default collision handling.
            CollidedWithTileAbove   += OnCollisionWithTileAbove;
            CollidedWithTileBelow   += OnCollisionWithTileBelow;
            CollidedWithTileToLeft  += OnCollisionWithTileToLeft;
            CollidedWithTileToRight += OnCollisionWithTileToRight;
            CollidedWithTerrain     += OnCollisionWithTerrain;

            RespawnPos = new Vector2(CollRectangle.X, CollRectangle.Y);
        }
Exemplo n.º 2
0
 void Awake()
 {
     instance = this;
 }
Exemplo n.º 3
0
 private void Awake()
 {
     Instance = this;
 }
Exemplo n.º 4
0
 void Awake()
 {
     instance = this;
 }