Пример #1
0
    void Start()
    {
        Globals.IsEditorScene = true;

        EditorCanvas = GameObject.Find("MainMenu");
        MainGame     = GameObject.Find("MainGame");
        GameMenu     = GameObject.Find("GameMenu");
        //MainCamera = GameObject.Find("MainCamera");
        UIConstractor            = GameObject.Find("ConstractorUI");
        MainLayerOnCanvas        = GameObject.Find("MainLayer");
        SpikeLayerOnCanvas       = GameObject.Find("SpikesLayer");
        LevelElementsCanvas      = GameObject.Find("LevelElementsMenu");
        OpenElementsCanvasButton = GameObject.Find("OpenElementsCanvasButton");
        EditorScrollView         = GameObject.Find("EditorScrollView");
        LevelGenerationMenu      = GameObject.Find("LevelGenerationMenu");
        Content = GameObject.Find("Content");

        AccordanceTileTypeAndSprite = new Dictionary <TileType, Sprite>
        {
            [TileType.Collectible]     = CollectibleTileSprite,
            [TileType.Empty]           = EmptyTileSprite,
            [TileType.Enemy]           = EnemyTileSprite,
            [TileType.HorizontalEnemy] = HorizontalEnemyTileSprite,
            [TileType.VerticalEnemy]   = VerticalEnemyTileSprite,
            [TileType.RandomEnemy]     = RandomEnemyTileSprite,
            [TileType.Hatch]           = HatchTileSprite,
            [TileType.Player]          = PlayerTileSprite,
            [TileType.Wall]            = WallTileSprite,
            [TileType.Star]            = StarTileSprite,
            [TileType.Exit]            = ExitTileSprite,
        };

        AccordanceSpikeTypeAndSprite = new Dictionary <SpikeType, Sprite>
        {
            [SpikeType.Bottom] = BottomSpikeSprite,
            [SpikeType.Top]    = TopSpikeSprite,
            [SpikeType.Right]  = RightSpikeSprite,
            [SpikeType.Left]   = LeftSpikeSprite
        };



        EditorCanvas.SetActive(true);
        MainGame.SetActive(false);
        LevelElementsCanvas.SetActive(false);
        GameMenu.SetActive(false);
        LevelGenerationMenu.SetActive(false);
        GameplaySettings.MainCamera = GameObject.Find("Camera");
        //var settings = GameplaySettings.Settings;

        InstantiateLevelField(10, 10);
    }