Пример #1
0
    // 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();
        }
    }
Пример #2
0
    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");
    }
Пример #3
0
    /// <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();
    }
Пример #4
0
 private void Start()
 {
     if (!Statics.canSwitchLever)
     {
         GetComponent <SpriteRenderer>().sprite = endLever;
     }
     moveWall = wall.GetComponent <MoveWall>();
 }
Пример #5
0
    public void RemoveMoveWall()
    {
        if (_hitMoveWall != null)
        {
            _hitMoveWall.RemoveJoint(this);
        }

        _hitMoveWall = null;
    }
Пример #6
0
 //動く床のプレイヤーの動き
 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
         {
         }
     }
 }
Пример #7
0
 public void RespawnPlayer()
 {
     Debug.Log("Player Respawn");
     player.transform.position = currentCheckpoint.transform.position;
     MoveWall.GetMoveWall().Move(currentCheckpoint.transform.position);
 }
Пример #8
0
 void Start()
 {
     moveWall = this;
 }
Пример #9
0
 // Start is called before the first frame update
 void Start()
 {
     moveplatformscript = FindObjectOfType <MoveWall>();
 }
Пример #10
0
 public void SetMoveWall(MoveWall move)
 {
     _hitMoveWall = move;
     _hitMoveWall.AddJoint(this);
 }