示例#1
0
 void Start()
 {
     scoreManager = FindObjectOfType <ScoreManager>();
     findMatches  = FindObjectOfType <FindMatches>();
     allCakes     = new GameObject[width, height];
     SetUp();
 }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     findMatches = FindObjectOfType <FindMatches>();
     allTiles    = new BackgroundTile[largura, altura];
     allDots     = new GameObject[largura, altura];
     SetUp();
 }
        public void Can_find_multiple_match()
        {
            // Arrange
            BinarySearchTree <int> treeOne  = new BinarySearchTree <int>();
            BinarySearchTree <int> treeTwo  = new BinarySearchTree <int>();
            List <int>             expected = new List <int>();

            expected.Add(4);
            expected.Add(8);

            treeOne.Add(4);
            treeOne.Add(2);
            treeOne.Add(6);
            treeOne.Add(8);

            treeTwo.Add(5);
            treeTwo.Add(4);
            treeTwo.Add(1);
            treeTwo.Add(8);

            // Act
            List <int> result = FindMatches.TreeIntersection(treeOne, treeTwo);

            // Assert
            Assert.Equal(expected, result);
        }
示例#4
0
 // Start is called before the first frame update
 void Start()
 {
     findMatches         = FindObjectOfType <FindMatches>();
     dataTracker         = FindObjectOfType <DataTracker>();
     powerBar            = FindObjectOfType <PowerBar>();
     audioSource         = GetComponent <AudioSource>();
     allAnimals          = new GameObject[width, height];
     currentState        = GameState.WAIT;
     activatedColumnBomb = false;
     activatedRowBomb    = false;
     activatedPower      = false;
     for (int j = 0; j < height; j++)
     {
         float y = j;
         for (int i = 0; i < width; i++)
         {
             float      x                   = i;
             GameObject newAnimalTile       = CreateNewAnimalTile(x, y);
             var        animalTileComponent = newAnimalTile.GetComponent <AnimalTile>();
             animalTileComponent.row    = (int)y;
             animalTileComponent.column = (int)x;
             allAnimals[(int)x, (int)y] = newAnimalTile;
         }
     }
 }
示例#5
0
    public void ActivatePower(int level)
    {
        if (board == null)
        {
            board = FindObjectOfType <Board>();
        }
        if (findMatches == null)
        {
            findMatches = FindObjectOfType <FindMatches>();
        }

        List <int> randomList = new List <int>();

        for (int i = 0; i < level; i++)
        {
            int numToAdd = Random.Range(0, 7);
            while (randomList.Contains(numToAdd))
            {
                numToAdd = Random.Range(0, 7);
            }
            randomList.Add(numToAdd);
        }

        foreach (int j in randomList)
        {
            for (int i = 0; i < board.height; i++)
            {
                GameObject testGameObject = board.allAnimals[j, i];
                testGameObject.GetComponent <AnimalTile>().isMatched = true;
                findMatches.currentMatches.Add(testGameObject);
            }
        }

        board.StartDestroyAllNow();
    }
示例#6
0
    // Start is called before the first frame update
    void Start()
    {
        isAreaBomb = false;

        isColumnBomb = false;
        isRowBomb    = false;

        //Use this for initialization
        board       = FindObjectOfType <Board>();
        findMatches = FindObjectOfType <FindMatches>();
        hintManager = FindObjectOfType <HintManager>();

        buttonManager = FindObjectOfType <ButtonManager>();
        powerUpPoints = FindObjectOfType <PowerUpPoints>();

        //Debug.Log(tigerButton);

        // targetX = (int)transform.position.x;
        // targetY = (int)transform.position.y;

        // row = targetY;
        //column = targetX;

        //previousColumn = column;
        // previousRow = row;
    }
示例#7
0
 void Start()
 {
     allTiles    = new GameObject[width, height];
     allDots     = new GameObject[width, height];
     findMatches = FindObjectOfType <FindMatches>();
     Setup();
 }
示例#8
0
 void Start()
 {
     findMatches = FindObjectOfType <FindMatches>();
     allTiles    = new BackgroundTile[width, hight];
     allDots     = new GameObject[width, hight];
     SetUp();
 }
示例#9
0
 void Start()
 {
     isColumnBomb = false;
     isRowBomb    = false;
     board        = FindObjectOfType <Board>();
     findMatches  = FindObjectOfType <FindMatches>();
 }
示例#10
0
    void Start()
    {
        isColumnBomb   = false;
        isRowBomb      = false;
        isColourBomb   = false;
        isAdjacentBomb = false;

        // Set the board component equal to the GameObject in the scene with the Board script attached
        board = GameObject.FindWithTag("Board").GetComponent <Board>();
        //board = FindObjectOfType<Board>();
        endGameManager = FindObjectOfType <EndGameManager>();
        findMatches    = FindObjectOfType <FindMatches>();
        hintManager    = FindObjectOfType <HintManager>();

        #region OLD CODE
        // Set the targetX and targetY values as this GameObjects X and Y positions (cast into a int)
        //targetX = (int)transform.position.x;
        //targetY = (int)transform.position.y;
        // Set the row and column
        //column = targetX;
        //row = targetY;
        //previousRow = row;
        //previousColumn = column;
        #endregion
    }
        public void Edge_case_of_matching_matches()
        {
            // Arrange
            BinarySearchTree <int> treeOne  = new BinarySearchTree <int>();
            BinarySearchTree <int> treeTwo  = new BinarySearchTree <int>();
            List <int>             expected = new List <int>();


            expected.Add(2);
            expected.Add(12);

            treeOne.Add(4);
            treeOne.Add(2);
            treeOne.Add(12);
            treeOne.Add(21);

            treeTwo.Add(5);
            treeTwo.Add(12);
            treeTwo.Add(12);
            treeTwo.Add(8);
            treeTwo.Add(2);

            // Act
            List <int> result = FindMatches.TreeIntersection(treeOne, treeTwo);

            // Assert
            Assert.Equal(expected, result);
        }
示例#12
0
 void Start()
 {
     endGameManager = FindObjectOfType <EndGameManager>();
     hintManager    = FindObjectOfType <HintManager>();
     board          = FindObjectOfType <Board>();
     findMatches    = FindObjectOfType <FindMatches>();
 }
示例#13
0
    //public SoundManager Sound;



    // Use this for initialization
    void Start()
    {
        //Identify other managers by name
        findMatches  = FindObjectOfType <FindMatches>();
        levelManager = FindObjectOfType <LevelManager>();
        trashManager = FindObjectOfType <TrashManager>();
        //burnScript = FindObjectOfType<BurnScript>();

        //Sound = FindObjectOfType<SoundManager>();


        allDots = new GameObject[width, height];

        //TODO : get current level
        levelManager.Load(level);

        SetUp();
        // TODO : add real trashes
        int[] canIdList = { 0, 1, 2, 3, 4 };
        trashManager.Init(canIdList);

        toCompost    = new GameObject[30];
        toRecycle    = new GameObject[30];
        toGlass      = new GameObject[30];
        toElectronic = new GameObject[30];
        toWaste      = new GameObject[30];
        // hello = GameObject.FindGameObjectWithTag("UUUIII");
    }
示例#14
0
文件: Board.cs 项目: dvatkov/Unity
 void Start()
 {
     _allTiles    = new BackgroundTile[width, height];
     allCircles   = new GameObject[width, height];
     _findMatches = FindObjectOfType <FindMatches>();
     AllTilesSetUp();
 }
示例#15
0
 void Start()
 {
     findMatches        = FindObjectOfType <FindMatches>();
     allBackgroundTiles = new BackgroundTile[width, height];
     allDotsOnBoard     = new GameObject[width, height];
     Setup();
 }
示例#16
0
 // Use this for initialization
 void Start()
 {
     findMatches = FindObjectOfType <FindMatches>();
     blankSpaces = new bool[width, height];
     allDots     = new GameObject[width, height];
     SetUp();
 }
示例#17
0
 public void ActivatePower(int level)
 {
     if (board == null)
     {
         board = FindObjectOfType <Board>();
     }
     if (findMatches == null)
     {
         findMatches = FindObjectOfType <FindMatches>();
     }
     for (int j = 0; j < level * 2; j++)
     {
         for (int i = 0; i < board.width; i++)
         {
             GameObject testGameObject = board.allAnimals[i, j];
             if (j % 2 == 0)
             {
                 if (i % 2 == 1)
                 {
                     testGameObject.GetComponent <AnimalTile>().isMatched = true;
                 }
             }
             else
             {
                 if (i % 2 == 0)
                 {
                     testGameObject.GetComponent <AnimalTile>().isMatched = true;
                 }
             }
             findMatches.currentMatches.Add(testGameObject);
         }
     }
     board.StartDestroyAllNow();
 }
示例#18
0
 // Start is called before the first frame update
 void Start()
 {
     findMatches = FindObjectOfType <FindMatches>();
     allTiles    = new BackgroundTile[width, height];
     allDots     = new GameObject[width, height];
     SetUp(); // Calling the SetUp() method
 }
示例#19
0
 void Start()
 {
     find         = FindObjectOfType <FindMatches>();
     scoreManager = FindObjectOfType <ScoreSystem>();
     allHexagons  = new GameObject[GridWidth, GridHeight]; //assign grid with width and height that can be controlled in editor
     SetUp();
 }
示例#20
0
 // Start is called before the first frame update
 void Start()
 {
     findMatches = FindObjectOfType <FindMatches>();
     allTiles    = new BackgroundTile[width, height];
     allDots     = new GameObject[width, height];
     Initialization();
 }
示例#21
0
    // Start is called before the first frame update
    void Start()
    {
        isColumnBomb   = false;
        isRowBomb      = false;
        isColourBomb   = false;
        isAdjacentBomb = false;

        //board = FindObjectOfType<Board>();

        board = GameObject.FindWithTag("Board").GetComponent <Board>();

        findMatches    = FindObjectOfType <FindMatches>();
        hintManager    = FindObjectOfType <HintManager>();
        shake          = FindObjectOfType <ScreenShake>();
        endGameManager = FindObjectOfType <EndGameManager>();

        explodable = GetComponent <Explodable>();

        audioSource = gameObject.GetComponent <AudioSource>();

        childObj = transform.Find("FollowMouse");

        if (board.AllJuice == true)
        {
            childObj.gameObject.SetActive(true);
        }
    }
示例#22
0
 // Use this for initialization
 void Start()
 {
     //Console.Write("5");
     findMatches = FindObjectOfType <FindMatches>();
     allTiles    = new BackgroundTile[width, height];
     allDots     = new GameObject[width, height];
     SetUp();
 }
示例#23
0
 // Start is called before the first frame update
 void Start()
 {
     scoreManager = FindObjectOfType <ScoreManager>();
     findMatches  = FindObjectOfType <FindMatches>();
     allTiles     = new BackgroundTile[width, height];
     allDots      = new GameObject[width, height];
     SetUp();
 }
示例#24
0
 void Start()
 {
     anim     = GetComponent <Animator>();
     board    = FindObjectOfType <Board>();
     target   = transform.position;
     mySprite = GetComponent <SpriteRenderer>();
     finder   = FindObjectOfType <FindMatches>();
 }
示例#25
0
    // Start is called before the first frame update
    void Start()
    {
        isColunaBomb = false;
        isLinhaBomb  = false;

        board       = FindObjectOfType <Board>();
        findMatches = FindObjectOfType <FindMatches>();
    }
示例#26
0
 // Start is called before the first frame update
 void Start()
 {
     controller  = FindObjectOfType <GameController>();
     findMatches = FindObjectOfType <FindMatches>();
     allTiles    = new BackgroundTile[width, height];
     allDots     = new GameObject[width, height];
     SetUp();
 }
示例#27
0
 // Start is called before the first frame update
 void Awake()
 {
     goalManager    = FindObjectOfType <GoalManager>();
     scoreManager   = FindObjectOfType <ScoreManager>();
     breakableTiles = new BackGroundTile[width, height];
     findMatches    = FindObjectOfType <FindMatches>();
     blankSpaces    = new bool[width, height];
     alldots        = new GameObject[width, height];
 }
示例#28
0
 void Start()
 {
     scoreManager   = FindObjectOfType <ScoreManager>();
     breakableTiles = new BackgroundTile[width, height];
     findMatches    = FindObjectOfType <FindMatches>();
     blankSpaces    = new bool[width, height];
     allDots        = new GameObject[width, height];
     SetUp();
 }
    // Start is called before the first frame update



    void Start()
    {
        scoreManager = FindObjectOfType <ScoreManager>();
        findMatches  = FindObjectOfType <FindMatches>();
        allTiles     = new BackgroundTile[width, height];
        allGems      = new GameObject[width, height];
        setUp();
        currentState = GameState.pause;
    }
示例#30
0
    void Start()
    {
        isColumnBomb = false;
        isRowBomb    = false;

        mySprite    = GetComponent <SpriteRenderer>();
        board       = FindObjectOfType <Board>();
        findMatches = FindObjectOfType <FindMatches>();
    }