getPoints() public method

public getPoints ( Vector2 off ) : Vector2[]
off Vector2
return Vector2[]
コード例 #1
0
    public override void OnInspectorGUI()
    {
        GUI.changed = false;
        DrawDefaultInspector();

        sc.rotation = EditorGUILayout.IntSlider("Rotation", sc.rotation, 0, 360 / sc.points);

        sc.advanced = EditorGUILayout.Toggle("Advanced", sc.advanced);
        if (sc.advanced)
        {
            sc.radiusA = EditorGUILayout.FloatField("RadiusA", sc.radiusA);
            sc.radiusB = EditorGUILayout.FloatField("RadiusB", sc.radiusB);
        }
        else
        {
            sc.radiusA = EditorGUILayout.Slider("RadiusA", sc.radiusA, 1, 25);
            sc.radiusB = EditorGUILayout.Slider("RadiusB", sc.radiusB, 1, 25);
        }


        if (GUI.changed || !off.Equals(polyCollider.offset))
        {
            polyCollider.points = sc.getPoints();
        }

        off = polyCollider.offset;
    }
コード例 #2
0
    void OnEnable()
    {
        sc = (StarCollider2D)target;

        edgeCollider = sc.GetComponent<EdgeCollider2D>();
        if (edgeCollider == null) {
            sc.gameObject.AddComponent<EdgeCollider2D>();
            edgeCollider = sc.GetComponent<EdgeCollider2D>();
        }
        edgeCollider.points = sc.getPoints(edgeCollider.offset);
    }
コード例 #3
0
    void OnEnable()
    {
        sc = (StarCollider2D)target;

        polyCollider = sc.GetComponent <PolygonCollider2D>();
        if (polyCollider == null)
        {
            polyCollider = sc.gameObject.AddComponent <PolygonCollider2D>();
        }
        polyCollider.points = sc.getPoints();
    }
コード例 #4
0
    void OnEnable()
    {
        sc = (StarCollider2D)target;

        edgeCollider = sc.GetComponent <EdgeCollider2D>();
        if (edgeCollider == null)
        {
            sc.gameObject.AddComponent <EdgeCollider2D>();
            edgeCollider = sc.GetComponent <EdgeCollider2D>();
        }
        edgeCollider.points = sc.getPoints(edgeCollider.offset);
    }
コード例 #5
0
    public override void OnInspectorGUI()
    {
        GUI.changed = false;
        DrawDefaultInspector();

        sc.rotation = EditorGUILayout.IntSlider("Rotation", sc.rotation, 0, 360 / sc.points);


        if (GUI.changed || !off.Equals(edgeCollider.offset))
        {
            edgeCollider.points = sc.getPoints(edgeCollider.offset);
        }

        off = edgeCollider.offset;
    }