示例#1
0
    // Use this for initialization
    void Start()
    {
        _levelDataHolder = GetComponent <LevelDataHolder>();

        _tileLocations        = new GameObject[LEVEL_SIZE, LEVEL_SIZE];
        _blueSpawnerLocations = new Vector3?[LEVEL_SIZE, LEVEL_SIZE];
        _redSpawnerLocations  = new Vector3?[LEVEL_SIZE, LEVEL_SIZE];
        GameplayDataManager.MinionLocations = new string[LEVEL_SIZE, LEVEL_SIZE];
        GameplayDataManager.FightHere       = new bool[LEVEL_SIZE, LEVEL_SIZE];
        _cursor = GameObject.Instantiate(Cursor, new Vector3(0.0f, 0.0f, 0.0f), Cursor.transform.rotation) as GameObject;
    }
示例#2
0
    void Start()
    {
        board = FindObjectOfType <BoardManager>();

        // add different tiles to inventory list that the inventory counter will keep track of. TODO: refactor this to use variables instead of hard coding tile names
        TileInventory.Add("Red Tile", 0);
        TileInventory.Add("Pink Tile", 0);
        TileInventory.Add("Green Tile", 0);
        TileInventory.Add("Black Tile", 0);
        TileInventory.Add("Orange Tile", 0);
        TileInventory.Add("Blue Tile", 0);

        wlConditions = FindObjectOfType <WinLose>();
        _sc          = FindObjectOfType <SelectorController>();
        _ldh         = FindObjectOfType <LevelDataHolder>();
    }
示例#3
0
 public void Start()
 {
     if (File.Exists("LevelOne.xml"))
     {
         LevelDataHolder dat = Loading();
         level = dat.level;
     }
     else
     {
         var serializer = new XmlSerializer(typeof(LevelDataHolder));
         using (var stream = new FileStream("LevelOne.xml", FileMode.Create))
         {
             //serializer.Serialize(stream, dataHolder);
         }
     }
 }
示例#4
0
    void Start()
    {
        instance = GetComponent <BoardManager>();

        Vector2 offset = tile.GetComponent <SpriteRenderer>().bounds.size;

        _mm = FindObjectOfType <MatchManager>();
        _ld = FindObjectOfType <LevelDataHolder>();
        _sc = FindObjectOfType <SelectorController>();

        if (!puzzleMode)
        {
            CreateBoard(offset.x, offset.y);
        }
        else
        {
            CreateBoard_Puzzle(offset.x, offset.y);
        }
    }
示例#5
0
    private void Awake()
    {
        // If there's nothing in the instance property, assign LevelDataHolder information to object.
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(gameObject);
        }
        // If there is, then there's another LevelDataHolder object. Destroy this one.
        else
        {
            Destroy(gameObject);
        }

        roomList = new List <RoomData>();
        for (int i = 0; i < levelGrid.transform.childCount; i++)
        {
            RoomData room = levelGrid.transform.GetChild(i).GetComponent <RoomData>();
            room.roomIndex = i;
            roomList.Add(room);
            Debug.Log("Setting " + room.name + " with index " + room.roomIndex);
        }
    }
示例#6
0
    //public string movesText;

    // Start is called before the first frame update
    void Start()
    {
        _selector  = FindObjectOfType <SelectorController>();
        _levelData = FindObjectOfType <LevelDataHolder>();
    }