void OnEnable() { scriptRef = (CircleForceField2D)target; transformRef = scriptRef.transform; useGamebjectDepthPreviousValue = scriptRef.useGamebjectDepth; boundsHandle.axes = PrimitiveBoundsHandle.Axes.X | PrimitiveBoundsHandle.Axes.Y; }
private bool CopyHandleSizeToCollider() { scriptRef = (CircleForceField2D)target; float radius = scriptRef.radius; float radiusScaleFactor = GetRadiusScaleFactor(); scriptRef.radius = ((!Mathf.Approximately(radiusScaleFactor, 0f)) ? (m_BoundsHandle.radius / GetRadiusScaleFactor()) : 0f); return(scriptRef.radius != radius); }
private void CopyColliderSizeToHandle() { scriptRef = (CircleForceField2D)target; m_BoundsHandle.radius = scriptRef.radius * GetRadiusScaleFactor(); }