コード例 #1
0
    void Update()
    {
        a.transform.localRotation += aRotationRate * Vec2.deg2rad * Time.deltaTime;
        a.transform.localScale     = aScale.ToCell();

        b.transform.localPosition = camera.ScreenToWorldPoint(Input.mousePosition).XY().ToCell();
        b.transform.localScale    = bScale.ToCell();

        Behavior.CoreUpdate();

        var collision = b.CheckCollision(a);

        if (collision != null)
        {
            b.transform.localPosition += collision.overlap;
            a.mesh.DebugDraw(Color.red);
        }
        else
        {
            a.mesh.DebugDraw(Color.yellow);
        }
    }