示例#1
0
 // Use this for initialization
 void Start()
 {
     canQuickDrop = true;
     lists        = GameObject.FindObjectOfType(typeof(BlockSpawn)) as BlockSpawn;
     curLoc       = this.transform.position;
     StartCoroutine("ResumeFall");
 }
示例#2
0
    void Awake()
    {
        instance = this;

        if (sameColorTest)
        {
            blockAmount = 0;
        }

        PlaceStartingBlocks();
    }
    // // Start is called before the first frame update
    void Start()
    {
        float xPosition = 1;

        for (int i = 0; i <= 5; i++)
        {
            BlockSpawn spawn = new BlockSpawn();
            spawn.position = new Vector2(xPosition, 9.5f);
            _blockSpawns.Add(spawn);
            xPosition += 1.6f;
            Debug.Log("??");
        }
        SetBlockSpawns();
        SpawnBlocks();
    }
    // called from bonus buttons
    public void OpenBonusPopup(BlockSpawn spawn)
    {
        if (spawn.hasBlock)
        {
            GreyOutOff();

            // which button was pressed Left, Center , Right
            bonusButton = spawn;

            // update bonus button text amounts
            bonusHoldAmountText.text   = gameState.GetBonusHoldAmount().ToString();
            bonusNewAmountText.text    = gameState.GetBonusNewAmount().ToString();
            bonusDeleteAmountText.text = gameState.GetBonusDeleteAmount().ToString();
            bonusBombAmountText.text   = gameState.GetBonusBombAmount().ToString();

            // display bonus popup image with buttons
            BonusPopup.SetActive(true);

            if (spawn.name == "LeftSpawn")
            {
                BonusPopupLeft.SetActive(true);
                GreyOutCenter.SetActive(true);
                GreyOutRight.SetActive(true);
            }

            if (spawn.name == "CenterSpawn")
            {
                BonusPopupCenter.SetActive(true);
                GreyOutLeft.SetActive(true);
                GreyOutRight.SetActive(true);
            }

            if (spawn.name == "RightSpawn")
            {
                BonusPopupRight.SetActive(true);
                GreyOutCenter.SetActive(true);
                GreyOutLeft.SetActive(true);
            }
        }
    }
示例#5
0
 /// <summary>
 /// Obtiene desde archivo el estilo de caida/desplazamiento de los bloques
 /// </summary>
 void GetBlockSpawnStyle()
 {
     //blockSpawnStyle = BlockSpawn.fall;
     //blockSpawnStyle = BlockSpawn.horizontal;
     blockSpawnStyle = BlockSpawn.push;
 }
示例#6
0
 private void Awake()
 {
     BlockSpawn.RegisterListener(OnBlockSpawn);
     BlockDespawn.RegisterListener(OnBlockDespawn);
 }
示例#7
0
 private void OnBlockSpawn(BlockSpawn blockSpawnEvent)
 {
     blockCount++;
     //Debug.Log("one block spawned. There are now a total of " + blocks.ToString() + " blocks");
 }
示例#8
0
 private void OnDestroy()
 {
     BlockSpawn.UnregisterListener(OnBlockSpawn);
     BlockDespawn.UnregisterListener(OnBlockDespawn);
 }
示例#9
0
 public int SpawnSort(BlockSpawn a, BlockSpawn b)
 {
     return(-a.spawnPriority.CompareTo(b.spawnPriority));
 }