// The collision goes off void OnTriggerEnter(Collider other) { // If its the squat wall if (other.tag == "SquatWall") { // Set the walls destroyed to how many walls went in to the trigger box if (other.name == "SquatWall(Clone)") { wallsDestroyed++; } if (other.name == "SquatWallx3(Clone)") { wallsDestroyed += 3; } if (other.name == "SquatWallx5(Clone)") { wallsDestroyed += 5; } if (other.name.Contains("CardioWall")) { wallsDestroyed++; } // Move the wall down when it hits MoveWall moveWall = other.GetComponent <MoveWall>(); moveWall.MoveDown(); } }
protected override void OnCantMove <T>(T component) { try { MoveWall disWall = component as MoveWall; disWall.AttemptMoveWall(horizontal, vertical); GameManager.instance.playersTurn = false; } catch (Exception) {} try { BreakWall hitWall = component as BreakWall; hitWall.DamageWall(); GameManager.instance.playersTurn = false; } catch (Exception) { } try { Enemy enemy = component as Enemy; enemy.DamageEnemy(); GameManager.instance.playersTurn = false; } catch (Exception) { } food--; SoundManager.instance.RandomizeSfx(chopSound1, chopSound2); foodText.text = "energy: " + food; animator.SetTrigger("PlatoAttack"); }
/// <summary> /// This will start the movement of any given Squat-Wall /// </summary> /// <param name="wallClone">Squat-Wall to start moving</param> /// <param name="speed">The speed that you want to set for your wall to move at</param> private void StartWallMovment(GameObject wallClone, float speed) { MoveWall moveWall = wallClone.GetComponent <MoveWall>(); moveWall.Speed(speed); moveWall.SetGibReady(); }
private void Start() { if (!Statics.canSwitchLever) { GetComponent <SpriteRenderer>().sprite = endLever; } moveWall = wall.GetComponent <MoveWall>(); }
public void RemoveMoveWall() { if (_hitMoveWall != null) { _hitMoveWall.RemoveJoint(this); } _hitMoveWall = null; }
//動く床のプレイヤーの動き private void PlayerWallMove() { if (moveWall != null) { WallAbility wa = moveWall.GetComponent <WallAbility>(); if (wa.abilityNumber == 8) { MoveWall mw = moveWall.GetComponent <MoveWall>(); mw.Move(gameObject, mw.speedX, mw.speedY); } else if (wa.abilityNumber == 9) { StageDate.Instance.SetData(SceneManager.GetActiveScene().name); fade.StartFadeIn("GameOver", false); } else { } } }
public void RespawnPlayer() { Debug.Log("Player Respawn"); player.transform.position = currentCheckpoint.transform.position; MoveWall.GetMoveWall().Move(currentCheckpoint.transform.position); }
void Start() { moveWall = this; }
// Start is called before the first frame update void Start() { moveplatformscript = FindObjectOfType <MoveWall>(); }
public void SetMoveWall(MoveWall move) { _hitMoveWall = move; _hitMoveWall.AddJoint(this); }