Exemplo n.º 1
0
        public async Task ShowExampleAsync(string message, string exampleImage, string acceptButtonText)
        {
            var tcs   = new TaskCompletionSource <bool>();
            var alert = new ExamplePopup(tcs, message, exampleImage, acceptButtonText);
            await PopupNavigation.PushAsync(alert);

            await tcs.Task;
            await PopupNavigation.RemovePageAsync(alert);
        }
Exemplo n.º 2
0
    static public void InitPopup(Transform t)
    {
        ExamplePopup popup = CreateInstance <ExamplePopup>();

        parentObject            = t;
        popup.name              = "Rename Children";
        popup.titleContent.text = "Rename Children";
        popup.position          = new Rect(Screen.width / 2, Screen.height / 2, 200, 400);
        popup.ShowUtility();
    }
Exemplo n.º 3
0
 public void ShowPopup()
 {
     ExamplePopup.Open();
 }
Exemplo n.º 4
0
    void GOToolGUI(Transform t)
    {
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Selected Object", GUILayout.MaxWidth(100.0f));
        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        string n = EditorGUILayout.TextField(t.name);

        if (GUILayout.Button("Deselect"))
        {
            Selection.activeGameObject = null;
        }
        EditorGUILayout.EndHorizontal();
        if (n != t.name)
        {
            t.name = n;
        }

        EditorGUILayout.Space();

        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Position", GUILayout.MaxWidth(50.0f));
        t.localPosition = EditorGUILayout.Vector3Field("", t.localPosition);
        EditorGUILayout.EndHorizontal();


        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Rotation", GUILayout.MaxWidth(50.0f));
        t.localRotation = Quaternion.Euler(EditorGUILayout.Vector3Field("", t.localRotation.eulerAngles));
        EditorGUILayout.EndHorizontal();


        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Scale", GUILayout.MaxWidth(50.0f));
        t.localScale = EditorGUILayout.Vector3Field("", t.localScale);
        EditorGUILayout.EndHorizontal();


        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Reset Position"))
        {
            t.localPosition = Vector3.zero;
        }
        if (GUILayout.Button("Reset Rotation"))
        {
            t.localRotation = Quaternion.identity;
            rotMover        = t.position + (t.forward * 1.5f);
        }
        if (GUILayout.Button("Reset Scale"))
        {
            t.localScale = Vector3.one;
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.Space();

        EditorGUILayout.Space();

        Component[] c = t.GetComponents <Component>();

        for (int i = 0; i < c.Length; i++)
        {
            EditorGUILayout.BeginHorizontal();
            GUILayout.Button(c[i].GetType().Name);
            if (GUILayout.Button("↑", GUILayout.Width(20.0f)))
            {
                UnityEditorInternal.ComponentUtility.MoveComponentUp(c[i]);
            }
            if (GUILayout.Button("↓", GUILayout.Width(20.0f)))
            {
                UnityEditorInternal.ComponentUtility.MoveComponentDown(c[i]);
            }
            if (GUILayout.Button("X", GUILayout.Width(20.0f)))   /*if (c[i].GetType() != typeof(Transform))*/
            {
            {
                Undo.DestroyObjectImmediate(c[i]);
            }
        }
        EditorGUILayout.EndHorizontal();
    }
    EditorGUILayout.Space();

    EditorGUILayout.BeginHorizontal();
    EditorGUILayout.LabelField("Rotate towards point", GUILayout.MaxWidth(125.0f));
    EditorGUI.BeginChangeCheck();
    rotateToggle = EditorGUILayout.Toggle(rotateToggle);
    if (EditorGUI.EndChangeCheck())
    {
        rotMover = t.position + (t.forward * 1.5f);
    }
    EditorGUILayout.EndHorizontal();

    EditorGUILayout.Space();

    if (GUILayout.Button("Rename Children"))
    {
        ExamplePopup.InitPopup(t);
    }

    EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

    EditorGUILayout.Space();
}