コード例 #1
0
ファイル: Projectile.cs プロジェクト: honux77/UnityRuby
    void OnCollisionEnter2D(Collision2D other)
    {
        //we also add a debug log to know what the projectile touch
        Debug.Log("Projectile Collision with " + other.gameObject);

        ClockController c = other.collider.GetComponent <ClockController>();

        if (c != null)
        {
            c.Fix();
        }

        Destroy(gameObject);
    }