コード例 #1
0
        private void ArrowGUI(Arrow arrow, string label)
        {
            if (arrow != null)
            {
                ArrowPrompt _target = (ArrowPrompt) target;

                arrow.isPresent = EditorGUILayout.Toggle ("Provide?", arrow.isPresent);

                if (arrow.isPresent)
                {
                    arrow.texture = (Texture2D) EditorGUILayout.ObjectField ("Icon texture:", arrow.texture, typeof (Texture2D), true);

                    EditorGUILayout.BeginHorizontal ();
                    arrow.linkedCutscene = (Cutscene) EditorGUILayout.ObjectField ("Linked Cutscene:", arrow.linkedCutscene, typeof (Cutscene), true);
                    if (arrow.linkedCutscene == null)
                    {
                        if (GUILayout.Button ("Create", GUILayout.MaxWidth (60f)))
                        {
                            Undo.RecordObject (_target, "Auto-create Cutscene");
                            Cutscene newCutscene = SceneManager.AddPrefab ("Logic", "Cutscene", true, false, true).GetComponent <Cutscene>();

                            newCutscene.gameObject.name = AdvGame.UniqueName (_target.gameObject.name + ": " + label);
                            arrow.linkedCutscene = newCutscene;
                        }
                    }
                    EditorGUILayout.EndHorizontal ();
                }
            }
        }