// Use this for initialization void Start() { canQuickDrop = true; lists = GameObject.FindObjectOfType(typeof(BlockSpawn)) as BlockSpawn; curLoc = this.transform.position; StartCoroutine("ResumeFall"); }
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); } } }
/// <summary> /// Obtiene desde archivo el estilo de caida/desplazamiento de los bloques /// </summary> void GetBlockSpawnStyle() { //blockSpawnStyle = BlockSpawn.fall; //blockSpawnStyle = BlockSpawn.horizontal; blockSpawnStyle = BlockSpawn.push; }
private void Awake() { BlockSpawn.RegisterListener(OnBlockSpawn); BlockDespawn.RegisterListener(OnBlockDespawn); }
private void OnBlockSpawn(BlockSpawn blockSpawnEvent) { blockCount++; //Debug.Log("one block spawned. There are now a total of " + blocks.ToString() + " blocks"); }
private void OnDestroy() { BlockSpawn.UnregisterListener(OnBlockSpawn); BlockDespawn.UnregisterListener(OnBlockDespawn); }
public int SpawnSort(BlockSpawn a, BlockSpawn b) { return(-a.spawnPriority.CompareTo(b.spawnPriority)); }