public static GravityOverrideCylinder DrawCylinder(ExtCylinder cylinder, ExtCircle circle1, ExtCircle circle2, GravityOverrideCylinder cylinderGravity, Color color, out bool hasChanged) { float sizeLine = cylinder.LocalScale.magnitude / 20; hasChanged = false; bool changed = hasChanged; cylinderGravity.Disc1 = ExtGravityOverrideEditor.DrawDisc(circle1, cylinderGravity.Disc1, color, false, out changed); hasChanged = (changed) ? true : hasChanged; cylinderGravity.Disc2 = ExtGravityOverrideEditor.DrawDisc(circle2, cylinderGravity.Disc2, color, false, out changed); hasChanged = (changed) ? true : hasChanged; cylinderGravity.Trunk = ExtGravityOverrideEditor.DrawLineTrunk(cylinderGravity.Trunk, cylinder.P1, cylinder.P2, new Color(color.r, color.g, color.b, color.a * 0.8f), sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; return(cylinderGravity); }
public static GravityOverrideConeSphereBase DrawConeSphereBase(ExtConeSphereBase cone, GravityOverrideConeSphereBase coneGravity, Color color, out bool hasChanged) { float sizeLine = cone.LocalScale.magnitude / 20; float sizePoint = cone.LocalScale.magnitude / 15; hasChanged = false; bool changed = hasChanged; coneGravity.Base = ExtGravityOverrideEditor.DrawDisc(cone.Base, coneGravity.Base, color, false, out changed); hasChanged = (changed) ? true : hasChanged; Color colorLine = new Color(color.r, color.g, color.b, color.a * 0.8f); coneGravity.Trunk = ExtGravityOverrideEditor.DrawLineTrunk(coneGravity.Trunk, cone.P1, cone.P2, colorLine, sizeLine, out changed); hasChanged = (changed) ? true : hasChanged; coneGravity.Top = ExtGravityOverrideEditor.DrawPoint(coneGravity.Top, cone.P1, color, sizePoint, out changed); hasChanged = (changed) ? true : hasChanged; return(coneGravity); }