コード例 #1
0
 void OnEnable()
 {
     scriptRef    = (CircleForceField2D)target;
     transformRef = scriptRef.transform;
     useGamebjectDepthPreviousValue = scriptRef.useGamebjectDepth;
     boundsHandle.axes = PrimitiveBoundsHandle.Axes.X | PrimitiveBoundsHandle.Axes.Y;
 }
コード例 #2
0
    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);
    }
コード例 #3
0
 private void CopyColliderSizeToHandle()
 {
     scriptRef             = (CircleForceField2D)target;
     m_BoundsHandle.radius = scriptRef.radius * GetRadiusScaleFactor();
 }