コード例 #1
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "Player")
     {
         Debug.Log("Hit player");
         respawn.Reload();
     }
 }
コード例 #2
0
ファイル: Timer.cs プロジェクト: fuhui0310/VGDCPlatformGame
 // Update is called once per frame
 void Update()
 {
     countdownText.text = ("Time Left = " + timeLeft);
     if (timeLeft <= 0)
     {
         StopCoroutine("LoseTime");
         respawn.Reload();
     }
 }
コード例 #3
0
    void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            Debug.Log("Hit player");
            respawn.Reload();
        }

        if (collision.gameObject.tag == "environment")
        {
            a      = TriggerZone.GetComponent <TriggerFall>();
            a.fall = 2;
            Destroy(gameObject);
        }
    }
コード例 #4
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "enemy")
     {
         Destroy(collision.gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         respawn.Reload();
     }
     else if (collision.gameObject.tag == "environment")
     {
         Destroy(gameObject);
     }
 }
コード例 #5
0
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.tag == "enemy")
     {
         Destroy(collision.gameObject);
     }
     else if (collision.gameObject.tag == "Player")
     {
         respawn.Reload();
     }
     else if (collision.gameObject.tag == "environment")
     {
         // Destroy(collision.gameObject);
     }
     else if (collision.gameObject.tag == "CrushBlock")
     {
         transform.Translate(Vector3.down * Time.deltaTime * slowSpeed);
         count = slowingTime;
     }
 }