示例#1
0
        void OnDrawGizmosSelected()
        {
            var iso_object = GetComponent <IsoObject>();

            if (iso_object && iso_object.isoWorld)
            {
                if (radius * 2 < height)
                {
                    IsoUtils.DrawIsoCube(
                        iso_object.isoWorld,
                        iso_object.position + offset,
                        new Vector3(radius * 2.0f, radius * 2.0f, height - radius),
                        Color.green);
                    IsoUtils.DrawIsoSphere(
                        iso_object.isoWorld,
                        iso_object.position + offset - IsoUtils.Vec3FromZ(height * 0.5f - radius),
                        radius,
                        Color.green);
                    IsoUtils.DrawIsoSphere(
                        iso_object.isoWorld,
                        iso_object.position + offset + IsoUtils.Vec3FromZ(height * 0.5f - radius),
                        radius,
                        Color.green);
                }
                else
                {
                    IsoUtils.DrawIsoSphere(
                        iso_object.isoWorld,
                        iso_object.position + offset,
                        radius,
                        Color.green);
                }
            }
        }