Exemplo n.º 1
0
    private void Awake()
    {
        //SINGLETON
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            GameObjectUtils.DebugErrorStop("Multiple instances of singleton.");
        }
        //SINGLETON

        Cells = new ACell[NB_CELLS];
        Transform waypointsTransform = GameObjectUtils.Find("Waypoints").transform;

        if (Cells.Length != waypointsTransform.childCount)
        {
            GameObjectUtils.DebugErrorStop("Not found " + Cells.Length + " waypoints on board. Found " + waypointsTransform.childCount + " instead.");
        }

        for (int i = 0; i < Cells.Length; i++)
        {
            Cells[i] = GenerateCell(IdentifyCell(i), i, waypointsTransform.GetChild(i));
        }

        //Subsribe to move manager
        MoveManager.OnMoved += RefreshBoardData;
    }
Exemplo n.º 2
0
    private void Awake()
    {
        //SINGLETON
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            GameObjectUtils.DebugErrorStop("Multiple instances of singleton.");
        }
        //SINGLETON

        Transform gooseGameObjectTransform = GameObjectUtils.Find(">>> GOOSE").transform;

        Gooses        = new AGoose[NB_GOOSES];
        goosesSprites = new Sprite[NB_GOOSES];
        for (int i = 0; i < Gooses.Length; i++)
        {
            Gooses[i]        = GenerateGoose(i, gooseGameObjectTransform.GetChild(i));
            goosesSprites[i] = gooseGameObjectTransform.GetChild(i).GetComponent <SpriteRenderer>().sprite;
        }

        CurrentGooseIndex = -1;

        currentGooseRenderer = GameObjectUtils.Find("Current Goose").GetComponent <SpriteRenderer>();
    }
 static public int Find_s(IntPtr l)
 {
     try {
         System.String a1;
         checkType(l, 1, out a1);
         var ret = GameObjectUtils.Find(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Exemplo n.º 4
0
    private void Awake()
    {
        //SINGLETON
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            GameObjectUtils.DebugErrorStop("Multiple instances of singleton.");
        }
        //SINGLETON

        RollButton  = GameObjectUtils.Find("Roll Button").GetComponent <Button>();
        victoryMenu = GameObjectUtils.Find("Victory Menu");
        victoryMenu.SetActive(false);
        pauseMenu = GameObjectUtils.Find("Pause Menu");
        pauseMenu.SetActive(false);
    }
Exemplo n.º 5
0
    private void Awake()
    {
        //SINGLETON
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            GameObjectUtils.DebugErrorStop("Multiple instances of singleton.");
        }
        //SINGLETON

        dice1 = GameObjectUtils.Find("Dice 1").GetComponent <SpriteRenderer>();
        dice2 = GameObjectUtils.Find("Dice 2").GetComponent <SpriteRenderer>();

        //Subsribe to game events
        GameManager.OnBeginTurn += SubMoveByDiceWhenRollEnd;
        GameManager.OnEndTurn   += UnsubMoveByDiceWhenRollEnd;
    }