Beispiel #1
0
        public static GameObject CreateEnemy(int x, int y, int level, bool hasKey = false)
        {
            GameObject go = GameObject.Instantiate("Monster");

            EnemyGenerator.Fill(rand, level, go, oneInNShiny);
            go.Transform.position = new Vec2i(x, y);

            Inventory i = (Inventory)go.AddComponent(new Inventory());

            if (hasKey)
            {
                i.Add(new Item("Key"));
                MapTile m = (MapTile)go.GetComponent <MapTile>();
                //m.character = 'k';
            }

            return(go);
        }