示例#1
0
    // Note: If gameObject is not found at first call (in case scene is not fully loaded), this function is called multiple times
    public override void Init()
    {
        this.currentTurn = 1;

        spawners = GameObject.FindGameObjectsWithTag("Spawner");
        if (spawners == null)
        {
            return;
        }
        if (spawners.Length == 0)
        {
            return;
        }

        // Instantiate initial pieces
        foreach (GameObject spawner in spawners)
        {
            string pieceName = Pieces.LotPieceName();
            spawner.GetComponent <PieceSpawner>().Spawn(pieceName);
        }

        // prepare unityads
        UnityAdsManager.GetInstance();

        // unlock pieces
        Pieces.Instance.UnLock();

        // initialize flg
        this.isInitialized = true;

        SocialPlatformsManager.Instance.Init();
    }
示例#2
0
    public void ExecPlayerPass()
    {
        foreach (GameObject spawner in spawners)
        {
            // delete current pieces
            spawner.GetComponent <PieceSpawner>().DestroyNotMovedPiece();

            // create next pieces
            string pieceName = Pieces.LotPieceName();
            spawner.GetComponent <PieceSpawner>().Spawn(pieceName);
            //Debug.Log(pieceName);
        }
    }
示例#3
0
    public void GoToNextTurn()
    {
        bool canSpawn = true;

        foreach (GameObject spawner in spawners)
        {
            if (spawner.GetComponent <PieceSpawner>().CanSpawn() == false)
            {
                canSpawn = false;
            }
        }

        if (canSpawn)
        {
            foreach (GameObject spawner in spawners)
            {
                string pieceName = Pieces.LotPieceName();
                spawner.GetComponent <PieceSpawner>().Spawn(pieceName);
            }
        }

        // next turn has come
        currentTurn++;
    }