Ejemplo n.º 1
0
        protected override void Awake()
        {
            base.Awake();

            Instance = this;

            var terrain = new TerrainComponent();

            Components.Add(terrain);

            terrain.Initialise();
        }
Ejemplo n.º 2
0
        // Use this for initialization
        void Awake()
        {
            if (Instance == null)
            {
                Instance = this;
            }
            else if (Instance != this)
            {
                Destroy(gameObject);
                enabled = false;
                gameObject.SetActive(false);
                return;
            }

            enemies = new List<Enemy>();
            BoardManager = FindObjectOfType<BoardManager>();
            DontDestroyOnLoad(gameObject);
        }
Ejemplo n.º 3
0
        public void InitBoard(GameManager gManager, int width, int height)
        {
            _gameManager = gManager;

            ClearBoard();

            transform.position = new Vector3(0f, 0f, 0);

            BoardHeight = height;
            BoardWidth = width;
            Gems = new List<GemLogic>(height*width);

            for (var i = 0; i < BoardWidth; i++){
                for (var j = 0; j < BoardHeight; j++){
                    AddGem(i, j);
                }
            }
        }