コード例 #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "PC")
     {
         HealthManager.Addpoints(PointToAdd);
         PC.GetComponent <Rigidbody2D>().velocity = new Vector2(GetComponent <Rigidbody2D>().velocity.x, JumpHeight);
     }
 }
コード例 #2
0
    void OnTriggerEnter2D(Collider2D Other)
    {
        if (Other.GetComponent <Rigidbody2D> () == null)
        {
            return;
        }

        HealthManager.Addpoints(PointToAdd);

        Destroy(gameObject);
    }