public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            GUILayout.BeginHorizontal();
            GUILayout.Label("Delay", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Delay = EditorGUILayout.FloatField(Delay);
            GUILayout.Label("S", WhiteTxtStyle);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //get all character
            var list = ObjectInfoHelper.GetCharacterNames();

            //set character index if initialize request
            if (Initialize)
            {
                //find origin object
                var origin = AssetDatabase.LoadAssetAtPath(Path, typeof(GameObject)) as GameObject;

                if (origin != null)
                {
                    //set index
                    Index = list.IndexOf(list.Where(c => c == origin.name).FirstOrDefault());
                }
                Initialize = false;
            }

            //choose character
            GUILayout.BeginHorizontal();
            GUILayout.Label("Character", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Index = EditorGUILayout.Popup(Index, list.ToArray());
            GUILayout.EndHorizontal();

            //find selected character
            string path     = ValueManager.CharaPath + list[Index] + ".prefab";
            var    selected = AssetDatabase.LoadAssetAtPath(path, typeof(GameObject)) as GameObject;

            if (selected != null)
            {
                //set character path
                Path = path;
            }

            //is wait for character disappear
            GUILayout.BeginHorizontal();
            GUILayout.Label("Is wait", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            IsWait = EditorGUILayout.Toggle(IsWait);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
Пример #3
0
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //initialize
            if (Initialize)
            {
                //find origin object
                var origin = AssetDatabase.LoadAssetAtPath(path, typeof(AudioClip)) as AudioClip;

                if (origin != null)
                {
                    //set background image
                    myAudio = origin;
                }
                Initialize = false;
            }

            //Choose audio
            GUILayout.BeginHorizontal();
            GUILayout.Label("Audio source", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            myAudio = EditorGUILayout.ObjectField(myAudio, typeof(AudioClip), false) as AudioClip;
            GUILayout.EndHorizontal();

            //get audio path
            if (myAudio != null)
            {
                path = AssetDatabase.GetAssetPath(myAudio);
            }

            //audio volume
            GUILayout.BeginHorizontal();
            GUILayout.Label("Volume", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            volume = EditorGUILayout.Slider(volume, 0, 1);
            GUILayout.EndHorizontal();

            //music loop
            GUILayout.BeginHorizontal();
            GUILayout.Label("Loop", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            loop = EditorGUILayout.Toggle(loop);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
Пример #4
0
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //character name
            GUILayout.BeginHorizontal();
            GUILayout.Label("Name", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            CharaName = EditorGUILayout.TextField(CharaName);
            GUILayout.EndHorizontal();

            //dialogue text box
            GUILayout.Label("Dialogue", WhiteTxtStyle);
            Dialog = EditorGUILayout.TextArea(Dialog, GUILayout.Height(50));


            ShowCharParam = EditorGUILayout.Foldout(ShowCharParam, "Character", true);
            if (ShowCharParam)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label("Font size", WhiteTxtStyle, GUILayout.Width(LabelWidth));
                fontSize = EditorGUILayout.IntField(fontSize);
                GUILayout.EndHorizontal();
                //dialogue text speed
                GUILayout.BeginHorizontal();
                GUILayout.Label("Text speed", WhiteTxtStyle, GUILayout.Width(LabelWidth));
                Speed = EditorGUILayout.IntSlider(Speed, 1, 5);
                GUILayout.EndHorizontal();
            }


            //dialog show in one shot
            GUILayout.BeginHorizontal();
            GUILayout.Label("No wait", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            NoWait = EditorGUILayout.Toggle(NoWait);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
Пример #5
0
 //------------------------------------------------------------------------/
 // Methods: Public
 //------------------------------------------------------------------------/
 /// <summary>
 /// Draws this node, as well as its connection points
 /// </summary>
 public void Draw(float scale)
 {
     GUI.Box(this.Rect, GUIContent.none, this.CurrentStyle);
     DrawContent();
     if (InPoint.Enabled)
     {
         InPoint.Draw(scale);
     }
     if (OutPoint.Enabled)
     {
         OutPoint.Draw(scale);
     }
     //var center = this.Rect.center;
     //GUI.Label(new Rect(center, new Vector2(Rect.width, Rect.height)), Name);
 }
Пример #6
0
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, "", Style);
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label("START", WhiteTxtStyle);
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.EndArea();

            OutPoint.Draw();

            base.Draw();
        }
Пример #7
0
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //initialize
            if (Initialize)
            {
                //find origin object
                var origin = AssetDatabase.LoadAssetAtPath(path, typeof(SceneAsset)) as SceneAsset;

                if (origin != null)
                {
                    //set Scene
                    Scene = origin;
                }
                Initialize = false;
            }

            //Choose image
            GUILayout.BeginHorizontal();
            GUILayout.Label("Scene", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Scene = EditorGUILayout.ObjectField(Scene, typeof(SceneAsset), false) as SceneAsset;
            GUILayout.EndHorizontal();

            if (Scene != null)
            {
                //get path
                path = AssetDatabase.GetAssetPath(Scene);
            }

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //find all story line in main game
            GameObject game = GameObject.FindGameObjectWithTag("dokidoki_vn_game");
            var        list = game.GetComponentsInChildren <StoryLine>().ToList();

            //set story line index if initialize request
            if (Initialize)
            {
                //find origin object
                var origin = list.Where(s => s.name == Name).FirstOrDefault();

                if (origin != null)
                {
                    //set index
                    Index = list.IndexOf(origin);
                }
                Initialize = false;
            }

            //get all story lines names
            var nameList = list.Select(s => s.gameObject.name).ToArray();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Story line", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Index = EditorGUILayout.Popup(Index, nameList);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //initialize
            if (Initialize)
            {
                //find origin object
                var origin = AssetDatabase.LoadAssetAtPath(Path, typeof(Sprite)) as Sprite;

                if (origin != null)
                {
                    //set background image
                    Image = origin;
                }
                Initialize = false;
            }

            //Choose image
            GUILayout.BeginHorizontal();
            GUILayout.Label("Image", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Image = EditorGUILayout.ObjectField(Image, typeof(Sprite), false) as Sprite;
            GUILayout.EndHorizontal();

            //is wait for background appear
            GUILayout.BeginHorizontal();
            GUILayout.Label("Is wait", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            IsWait = EditorGUILayout.Toggle(IsWait);
            GUILayout.EndHorizontal();

            if (Image != null)
            {
                //get path
                Path = AssetDatabase.GetAssetPath(Image);
                //show preview
                GUILayout.Label(Image.texture, GUILayout.Width(200), GUILayout.Height(113));
                if (myRect.height == DefaultRectHeight)
                {
                    myRect.height = DefaultRectHeight + 110;
                }
            }
            else
            {
                //clear path
                Path = "";
                if (myRect.height != DefaultRectHeight)
                {
                    myRect.height = DefaultRectHeight;
                }
            }

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
Пример #10
0
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //get all cg
            var list = ObjectInfoHelper.GetCGsName();

            if (Initialize)
            {
                //find origin object
                var origin = AssetDatabase.LoadAssetAtPath(Path, typeof(Sprite)) as Sprite;
                if (origin != null)
                {
                    //set index
                    Index = list.IndexOf(list.Where(c => c == origin.name).FirstOrDefault());
                }
                Initialize = false;
            }

            //selector for cg
            GUILayout.BeginHorizontal();
            GUILayout.Label("CG", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Index = EditorGUILayout.Popup(Index, list.ToArray());
            GUILayout.EndHorizontal();
            //set cg path
            Path = ValueManager.CGPath + list[Index] + ".jpg";

            //is wait for CG appear
            GUILayout.BeginHorizontal();
            GUILayout.Label("Is wait", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            IsWait = EditorGUILayout.Toggle(IsWait);
            GUILayout.EndHorizontal();

            //GUILayout.BeginHorizontal();
            //GUILayout.FlexibleSpace();
            //load preview cg
            string path       = ValueManager.CGPath + list[Index] + ".jpg";
            var    imgPriveiw = AssetDatabase.LoadAssetAtPath(path, typeof(Sprite)) as Sprite;

            if (imgPriveiw != null)
            {
                GUILayout.Label(imgPriveiw.texture, GUILayout.Width(200), GUILayout.Height(113));
            }
            //GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }
        public override void Draw()
        {
            GUILayout.BeginArea(myRect, Title, Style);
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Space(SpacePixel);
            GUILayout.FlexibleSpace();
            GUILayout.BeginVertical();
            GUILayout.Space(SpacePixel);

            //get all character
            var list = ObjectInfoHelper.GetCharacterNames();

            //set character index if initialize request
            if (Initialize)
            {
                //find origin object
                var origin = AssetDatabase.LoadAssetAtPath(Path, typeof(GameObject)) as GameObject;

                if (origin != null)
                {
                    //set index
                    Index = list.IndexOf(list.Where(c => c == origin.name).FirstOrDefault());
                }
                Initialize = false;
            }

            //choose character
            GUILayout.BeginHorizontal();
            GUILayout.Label("Character", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            Index = EditorGUILayout.Popup(Index, list.ToArray());
            GUILayout.EndHorizontal();

            //find selected character
            string path     = ValueManager.CharaPath + list[Index] + ".prefab";
            var    selected = AssetDatabase.LoadAssetAtPath(path, typeof(GameObject)) as GameObject;

            if (selected != null)
            {
                //set character path
                Path = path;
                //get all sprites name
                var spriteList = selected.GetComponentsInChildren <CharaSpriteSetting>().Select(s => s.name).ToArray();

                //character sprite
                GUILayout.BeginHorizontal();
                GUILayout.Label("Sprite", WhiteTxtStyle, GUILayout.Width(LabelWidth));
                SpriteIndex = EditorGUILayout.Popup(SpriteIndex, spriteList);
                GUILayout.EndHorizontal();

                //select character face if existe
                var faceList = selected.transform.GetChild(SpriteIndex).GetComponentInChildren <CharaFaceSetting>().
                               GetComponentsInChildren <Image>().Select(f => f.name).ToArray();

                if (faceList.Length > 0)
                {
                    //set face index to 0 if has face
                    if (FaceIndex < 0)
                    {
                        FaceIndex = 0;
                    }

                    GUILayout.BeginHorizontal();
                    GUILayout.Label("Face", WhiteTxtStyle, GUILayout.Width(LabelWidth));
                    FaceIndex = EditorGUILayout.Popup(FaceIndex, faceList);
                    GUILayout.EndHorizontal();
                }
                else
                {
                    //no face selected
                    FaceIndex = -1;
                }
            }

            //character postion
            var charaPosList = Enum.GetValues(typeof(CharacterPosition))
                               .Cast <int>()
                               .Select(x => Enum.GetName(typeof(CharacterPosition), x))
                               .ToArray();

            GUILayout.BeginHorizontal();
            GUILayout.Label("Position", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            CharaPos = (CharacterPosition)EditorGUILayout.Popup((int)CharaPos, charaPosList);
            GUILayout.EndHorizontal();

            //custom position
            if (CharaPos == CharacterPosition.Custom)
            {
                if (myRect.height == DefaultRectHeight)
                {
                    myRect.height = DefaultRectHeight + 20;
                }
                CustomPos = EditorGUILayout.Vector2Field("", CustomPos);
            }
            else
            {
                if (myRect.height != DefaultRectHeight)
                {
                    myRect.height = DefaultRectHeight;
                }
            }

            //is wait for character appear
            GUILayout.BeginHorizontal();
            GUILayout.Label("Is wait", WhiteTxtStyle, GUILayout.Width(LabelWidth));
            IsWait = EditorGUILayout.Toggle(IsWait);
            GUILayout.EndHorizontal();

            GUILayout.EndVertical();
            GUILayout.Space(SpacePixel);
            GUILayout.EndHorizontal();
            GUILayout.EndArea();

            InPoint.Draw();
            OutPoint.Draw();

            base.Draw();
        }