public virtual void SetupBlock() { this._blockType = BlockInfo.BlockTypes.NONE; this._blockState = BlockInfo.BlockState.NONE; this._firstDirection = BlockInfo.BlockDirection.NONE; this._secondDirection = BlockInfo.BlockDirection.NONE; this.SetTileMaterial(); }
public override void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockDirection firstDirection, BlockInfo.BlockDirection secondDirection) { base.SetupBlock(type, firstDirection, secondDirection); this.isUp = false; #if UNITY_EDITOR this.SetMiscMaterial(); #endif this.blockRenderer.sharedMaterials = this.blockMaterials; }
public virtual void SetupBlock(BlockInfo.BlockTypes type, int initCounter) { this._blockType = type; this._blockState = BlockInfo.BlockState.NONE; this._firstDirection = BlockInfo.BlockDirection.NONE; this._secondDirection = BlockInfo.BlockDirection.NONE; this.SetTileMaterial(); }
public virtual void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockState state) { this._blockType = type; this._blockState = state; this._previousState = state; this._firstDirection = BlockInfo.BlockDirection.NONE; this._secondDirection = BlockInfo.BlockDirection.NONE; this.SetTileMaterial(); }
public override void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockDirection direction, BlockInfo.BlockState state) { base.SetupBlock(type, direction, state); this.warpDirection = (PlayerInfo.MovementDirection)((int)direction); #if UNITY_EDITOR this.SetMiscMaterial(); #endif this.blockMaterials[1] = this.warpDownMaterial; this.blockRenderer.sharedMaterials = this.blockMaterials; }
public virtual void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockDirection direction) { this._blockType = type; this._blockState = BlockInfo.BlockState.NONE; this._firstDirection = direction; this._secondDirection = BlockInfo.BlockDirection.NONE; this._blockDirections.Add(direction); this.firstDirectionValue = (int)direction; this.SetTileMaterial(); }
public virtual void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockDirection firstDirection, BlockInfo.BlockDirection secondDirection, BlockInfo.BlockState state) { this._blockType = type; this._blockState = state; this._previousState = state; this._firstDirection = firstDirection; this._secondDirection = secondDirection; this._blockDirections.Add(firstDirection); this._blockDirections.Add(secondDirection); this.firstDirectionValue = (int)firstDirection; this.secondDirectionValue = (int)secondDirection; this.SetTileMaterial(); }
public override void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockDirection firstDirection, BlockInfo.BlockDirection secondDirection, BlockInfo.BlockState state) { base.SetupBlock(type, firstDirection, secondDirection, state); if (state == BlockInfo.BlockState.UP) { this.isUp = true; #if UNITY_EDITOR this.SetMiscMaterial(); #endif this.blockRenderer.sharedMaterials = this.blockMaterials; } else { #if UNITY_EDITOR this.SetMiscMaterial(); #endif this.blockRenderer.sharedMaterials = this.blockMaterials; } }
public void UndoBlocks(PlayerInfo.MovementDirection currentDirection, PlayerInfo.MovementDirection previousDirection) { int i = 0; int count = 0; BlockInfo.BlockDirection current = (BlockInfo.BlockDirection)((int)currentDirection); BlockInfo.BlockDirection previous = (BlockInfo.BlockDirection)((int)previousDirection); if (currentDirection == previousDirection) { if (this._numberBlocks.Count > 0) { count = this._numberBlocks.Count; for (i = 0; i < count; i++) { this._numberBlocks[i].Undo(); } } this.blocksReady = true; return; } if (this._numberBlocks.Count > 0) { count = this._numberBlocks.Count; for (i = 0; i < count; i++) { this._numberBlocks[i].Undo(); } } if (this._normalBlocks.Count > 0) { count = this._normalBlocks.Count; for (i = 0; i < count; i++) { if (this._normalBlocks[i].FirstDirection == current) { this._normalBlocks[i].BlockState = this._normalBlocks[i].PreviousState; } if (this._normalBlocks[i].FirstDirection == previous) { this._normalBlocks[i].BlockState = this._normalBlocks[i].PreviousState; } else if (previous == BlockInfo.BlockDirection.NONE) { this._normalBlocks[i].BlockState = this._normalBlocks[i].FirstState; } } } if (this._multiBlocks.Count > 0) { count = this._multiBlocks.Count; for (i = 0; i < count; i++) { if (this._multiBlocks[i].BlockDirections.Contains(current) && !this._multiBlocks[i].BlockDirections.Contains(previous)) { this._multiBlocks[i].BlockState = this._multiBlocks[i].PreviousState; } if (this._multiBlocks[i].BlockDirections.Contains(previous)) { if (!this._multiBlocks[i].isUp) { this._multiBlocks[i].BlockState = this._multiBlocks[i].PreviousState; } } else if (previous == BlockInfo.BlockDirection.NONE) { this._multiBlocks[i].BlockState = this._multiBlocks[i].FirstState; } } } if (this._switchBlocks.Count > 0) { count = this._switchBlocks.Count; for (i = 0; i < count; i++) { if (this._switchBlocks[i].IsFlipped) { this._switchBlocks[i].Undo(); this._switchBlocks[i].IsFlipped = false; } } } this.blocksReady = true; }
/// <summary> /// This Function is called whenever the player moves around, so that we can activate the blocks connnected to each movement. /// </summary> /// <param name="currentDirection">The Current Direction The Player Is Moving At.</param> /// <param name="previousDirection">The Previous Direction The Player Was Moving Before.</param> public void ActivateBlocks(PlayerInfo.MovementDirection currentDirection, PlayerInfo.MovementDirection previousDirection) { int i = 0; int count = 0; BlockInfo.BlockDirection current = (BlockInfo.BlockDirection)((int)currentDirection); //BlockInfo.BlockDirection previous = (BlockInfo.BlockDirection)((int)previousDirection); if (currentDirection == previousDirection) { if (this._numberBlocks.Count > 0) { count = this._numberBlocks.Count; for (i = 0; i < count; i++) { if (this._numberBlocks[i].currentCounter == 1) { if (this._numberBlocks[i].isReversed) { this._numberBlocks[i].BlockState = BlockInfo.BlockState.DOWN; } else { this._numberBlocks[i].BlockState = BlockInfo.BlockState.UP; } } else { if (this._numberBlocks[i].isReversed) { this._numberBlocks[i].BlockState = BlockInfo.BlockState.UP; } else { this._numberBlocks[i].BlockState = BlockInfo.BlockState.DOWN; } } } } this.blocksReady = true; return; } if ((this._numberBlocks.Count | this._normalBlocks.Count | this._multiBlocks.Count) > 0) { GridAudio.instance.PlayMovement(); } if (this._numberBlocks.Count > 0) { count = this._numberBlocks.Count; for (i = 0; i < count; i++) { if (this._numberBlocks[i].currentCounter == 1) { if (this._numberBlocks[i].isReversed) { this._numberBlocks[i].BlockState = BlockInfo.BlockState.DOWN; } else { this._numberBlocks[i].BlockState = BlockInfo.BlockState.UP; } } else { if (this._numberBlocks[i].isReversed) { this._numberBlocks[i].BlockState = BlockInfo.BlockState.UP; } else { this._numberBlocks[i].BlockState = BlockInfo.BlockState.DOWN; } } } } if (this._normalBlocks.Count > 0) { count = this._normalBlocks.Count; for (i = 0; i < count; i++) { if (this._normalBlocks[i].FirstDirection == current) { if (this._normalBlocks[i].isUp) { continue; } else { this._normalBlocks[i].BlockState = BlockInfo.BlockState.UP; } } else { if (this._normalBlocks[i].isUp) { this._normalBlocks[i].BlockState = BlockInfo.BlockState.DOWN; } } } } if (this._multiBlocks.Count > 0) { count = this._multiBlocks.Count; for (i = 0; i < count; i++) { if (this._multiBlocks[i].BlockDirections.Contains(current)) { if (this._multiBlocks[i].isUp) { this._multiBlocks[i].PreviousState = BlockInfo.BlockState.UP; continue; } else { this._multiBlocks[i].BlockState = BlockInfo.BlockState.UP; } } else { if (this._multiBlocks[i].isUp) { this._multiBlocks[i].BlockState = BlockInfo.BlockState.DOWN; } } } } this.blocksReady = true; }
public virtual void SetupBlock(BlockInfo.BlockTypes type) { this._blockType = type; this._blockState = BlockInfo.BlockState.NONE; this._firstDirection = BlockInfo.BlockDirection.NONE; this._secondDirection = BlockInfo.BlockDirection.NONE; this.SetTileMaterial(); }
public virtual void SetupBlock(BlockInfo.BlockTypes type, BlockInfo.BlockState state, int initCounter) { this._blockType = type; this._blockState = state; this._previousState = state; this._firstDirection = BlockInfo.BlockDirection.NONE; this._secondDirection = BlockInfo.BlockDirection.NONE; this.SetTileMaterial(); }