コード例 #1
0
    private void OnCollisionEnter(Collision collision)
    {
        GameObject other = collision.gameObject;

        if (other.tag == "Element")
        {
            ElementController ec = other.GetComponent <ElementController>();

            float mass   = ec.GetMass();
            float volume = ec.GetVolume();
            scaleText.text = "Mass: " + mass + "\n" + "Volume: " + volume;
        }
    }