public virtual void Start()
 {
     // Assign references:
     gameManager  = GetComponent <GameManagerScript>();
     matchManager = GetComponent <MatchManagerScript>();
     lerpPercent  = 0;
 }
예제 #2
0
 private void Start()
 {
     hearts         = new Image[transform.childCount];
     hearts         = FindHearts();
     matchManager   = transform.root.Find(GAME_MANAGER).GetComponent <MatchManagerScript>();
     winLoseManager = transform.root.Find(GAME_MANAGER).GetComponent <WinLoseManager>();
 }
    Vector2 exchangeGridPos2;                    //The position of exchangeToken2 in the scene.

    public virtual void Start()
    {
        gameManager      = GetComponent <GameManagerScript>();  //Set the gameManager variable to the GameManagerScript component on the GameObject.
        matchManager     = GetComponent <MatchManagerScript>(); //Set the matchManager variable to the MatchManagerScript component on the GameObject.
        lerpPercent      = 0;                                   //Reset the lerp percentage to 0 so that tokens don't move until the right time.
        repopulateScript = GetComponent <RepopulateScript>();
    }
예제 #4
0
 private void Start()
 {
     meter              = GetComponent <Image>();
     maxDelay           = angerDelay;
     angerTimer         = angerDelay;
     matchManagerScript = transform.root.Find(GAMEMANAGER).GetComponent <MatchManagerScript>();
     scoreManager       = transform.parent.Find(SCORE_NAME).GetComponent <ScoreManager>();
     healthManager      = transform.parent.Find(LIFE_ICONS).GetComponent <HealthManager>();
 }
예제 #5
0
 public void Awake()
 {
     _instance = this;
     if (VictoryText != null)
     {
         VictoryText.text = "";
     }
     DidScheduleRestart = false;
 }
예제 #6
0
 //can be overridden
 public virtual void Start()
 {
     tokenTypes = (Object[])Resources.LoadAll("_Core/Tokens/"); //grabbing prefabs
     gridArray  = new GameObject[gridWidth, gridHeight];        //creating the grid
     MakeGrid();                                                //populating the grid
     matchManager      = GetComponent <MatchManagerScript>();   //assigning scripts to variables
     inputManager      = GetComponent <InputManagerScript>();
     repopulateManager = GetComponent <RepopulateScript>();
     moveTokenManager  = GetComponent <MoveTokensScript>();
 }
예제 #7
0
 public virtual void Start()
 {
     tokenTypes = (Object[])Resources.LoadAll("_Core/Tokens/");
     gridArray  = new GameObject[gridWidth, gridHeight];
     MakeGrid();
     matchManager      = GetComponent <MatchManagerScript>();
     inputManager      = GetComponent <InputManagerScript>();
     repopulateManager = GetComponent <RepopulateScript>();
     moveTokenManager  = GetComponent <MoveTokensScript>();
 }
 public virtual void Start()
 {
     //load the tokens, make the grid, and create references to the other scripts
     tokenTypes = (Object[])Resources.LoadAll("Tokens/");
     gridArray  = new GameObject[gridWidth, gridHeight];
     MakeGrid();
     matchManager      = GetComponent <MatchManagerScript>();
     inputManager      = GetComponent <InputManagerScript>();
     repopulateManager = GetComponent <RepopulateScript>();
     moveTokenManager  = GetComponent <MoveTokensScript>();
 }
예제 #9
0
    public virtual void Start()
    {
        tokenTypes = Resources.LoadAll("Tokens/");
        gridArray  = new GameObject[gridWidth, gridHeight];
        MakeGrid();

        matchManager = GetComponent <MatchManagerScript>();
        Debug.Assert(matchManager != null, "Attach a match manager to this object.");

        inputManager      = GetComponent <InputManagerScript>();
        repopulateManager = GetComponent <RepopulateScript>();
        moveTokenManager  = GetComponent <MoveTokensScript>();
    }
예제 #10
0
 public virtual void Awake()
 {
     tokenTypes        = (UnityEngine.Object[])Resources.LoadAll("Tokens/");
     noteSprites       = Resources.LoadAll <Sprite>("Sprites/Note sprites");
     gridArray         = new GameObject[gridWidth, gridHeight];
     matchManager      = GetComponent <MatchManagerScript>();
     inputManager      = GetComponent <InputManagerScript>();
     repopulateManager = GetComponent <RepopulateScript>();
     moveTokenManager  = GetComponent <MoveTokensScript>();
     numberManager     = GetComponent <NumberManager>();
     stringGraphic     = Resources.Load("String") as GameObject;
     timeBetweenBeats  = 60.0f / bpm;
     music             = GameObject.Find(SPEAKER_OBJ).GetComponent <AudioSource>();
     healthText        = transform.root.Find(UI_CANVAS).Find(HEALTH_TEXT).GetComponent <Text>();
     MakeGrid();
     ChangeGridDuplicates();
 }
    public virtual void Start()
    {
        _tokenTypes = Resources.LoadAll("ChessPieces/");
        gridArray   = new GameObject[gridWidth, gridHeight];
        MakeGrid();

        if (playerColor == ChessPiece.PieceColor.Black)
        {
            opponentColor = ChessPiece.PieceColor.White;
        }
        else
        {
            opponentColor = ChessPiece.PieceColor.Black;
        }

        matchManager       = GetComponent <MatchManagerScript>();
        inputManager       = GetComponent <InputManagerScript>();
        repopulateManager  = GetComponent <RepopulateScript>();
        moveTokenManager   = GetComponent <MoveTokensScript>();
        opponentController = GetComponent <OpponentController>();
    }
예제 #12
0
 public virtual void Start()
 {
     //load the tokens, make the grid, and create references to the other scripts
     tokenTypes        = (UnityEngine.Object[])Resources.LoadAll("Tokens/");
     dummySprites      = Resources.LoadAll <Sprite>("Sprites/Dummy sprites");
     gridArray         = new GameObject[gridWidth, gridHeight];
     matchManager      = GetComponent <MatchManagerScript>();
     inputManager      = GetComponent <InputManagerScript>();
     repopulateManager = GetComponent <RepopulateScript>();
     moveTokenManager  = GetComponent <MoveTokensScript>();
     scoreManager      = transform.root.Find("Score canvas").Find("Score").GetComponent <ScoreManager>();
     stringGraphic     = Resources.Load("String") as GameObject;
     MakeGrid();
     ChangeGridDuplicates();
     SceneManager.LoadScene(INSTRUCTION_SCENE_NAME, LoadSceneMode.Additive);
     winLoseManager     = GetComponent <WinLoseManager>();
     chordsRemaining    = transform.root.Find(SCORE_CANVAS).Find(CHORDS_REMAINING).GetComponent <Text>();
     ChordsPlayed       = 0;   //set the text correctly at the start of the game
     scoreRequired      = transform.root.Find(SCORE_CANVAS).Find(SCORE_REQUIRED).GetComponent <Text>();
     scoreRequired.text = winLoseManager.ScoreToWin + " to win";
 }
예제 #13
0
 void Awake()
 {
     token = GetComponent <MatchManagerScript> ();
 }
예제 #14
0
 //this runs at the start
 public virtual void Start()
 {
     gameManager  = GetComponent <GameManagerScript>();
     matchManager = GetComponent <MatchManagerScript>();
     lerpPercent  = 0;
 }
예제 #15
0
 public virtual void Start()
 {
     gameManager      = GetComponent <GameManagerScript>();
     matchManager     = GetComponent <MatchManagerScript>();
     timeBetweenBeats = gameManager.TimeBetweenBeats;
 }
 //this runs at the start
 private void Start()
 {
     gameManager  = GetComponent <GameManagerScript>();
     matchManager = GetComponent <MatchManagerScript>();
     lerpPercent  = 0;
 }
    public List <Vector2> toBeRemoved = new List <Vector2>();   //to store gameobjects/tiles that want to be removed after matching

    //ADDED this
    public void Awake()
    {
        instance = this;
    }