示例#1
0
    private void DrawColliderCreation()
    {
        GUILayout.Space(10);

        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.BeginVertical();
        GUILayout.Label("Collider creation:");
        GUILayout.Space(5);
        GUILayout.BeginHorizontal();
        if (!editor.colliderCreation)
        {
            if (GUILayout.Button("Create New Collider "))
            {
                editor.LoadColliders();
                editor.CreateCollider();
            }
        }
        else
        {
            GUILayout.Button("Creating collider...");
        }
        if (editor.colliderCreation)
        {
            if (GUILayout.Button("Collider done"))
            {
                editor.ColliderAssignPoints();
            }
        }
        else
        {
            GUILayout.Button(" Waiting... ");
        }
        GUILayout.EndHorizontal();

        GUILayout.Space(10);

        for (int i = 0; i < editor.colliderPoints.Count; i++)
        {
            Vector2 point = editor.colliderPoints[i];
            GUILayout.Label("Point: " + i + ": (x " + point.x + ", y " + point.y + ")");
        }
        GUILayout.EndVertical();
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();

        GUILayout.Space(40);
    }