Ejemplo n.º 1
0
 public override void OnDelete(DialogCanvas canvas)
 {
     if (canvas.definedPoints.ContainsKey(pointKey))
     {
         canvas.definedPoints.Remove(pointKey);
     }
 }
Ejemplo n.º 2
0
 private void FindDialogPanel()
 {
     dialogCanvas = FindObjectOfType <DialogCanvas>();
     if (dialogCanvas != null)
     {
         dialog = dialogCanvas.GetComponentInChildren <DialogPanel>(true);
     }
 }
    public void Select(int idx)
    {
        if (dialogController == null)
        {
            dialogController = (DialogCanvas)UIMgr.Instance.GetCurrentCanvas();
        }

        dialogController.dialogAnimator.SetInteger("Selected", idx);
    }
    public void SelectSelectionData(SelectionData selectionData)
    {
        if (dialogController == null)
        {
            dialogController = (DialogCanvas)UIMgr.Instance.GetCurrentCanvas();
        }

        dialogController.SetSelection(selectionData);
    }
    public void SetTalkData(TalkData talkData)
    {
        if (dialogController == null)
        {
            dialogController = (DialogCanvas)UIMgr.Instance.GetCurrentCanvas();
        }

        dialogController.SetTalk(talkData);
    }
    public void CinematicOn()
    {
        Debug.Log("다이얼로그 정지, 애니메이션 실행");

        if (dialogController == null)
        {
            dialogController = (DialogCanvas)UIMgr.Instance.GetCurrentCanvas();
        }

        dialogController.Pause();
        timelineController.Play();
    }
    public void DialogOn()
    {
        Debug.Log("타임라인 정지, 다이얼로그 시작");

        if (dialogController == null)
        {
            dialogController = (DialogCanvas)UIMgr.Instance.GetCurrentCanvas();
        }

        dialogController.Play();
        timelineController.Pause();
    }
Ejemplo n.º 8
0
 private DialogCanvas SpawnCanvas()
 {
     if (dialogCanvas != null)
     {
         return(dialogCanvasInstance = (DialogCanvas)Instantiate(dialogCanvas, Vector3.zero, Quaternion.identity));
     }
     else
     {
         Debug.LogWarning("DialogManager/SpawnCanvas () : no prefab of dialogCanvas is assigned. Not spawning Canvas");
         return(null);
     }
 }
Ejemplo n.º 9
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
         canvas = GetComponent <Canvas> ();
     }
     else
     {
         DestroyImmediate(gameObject);
     }
 }
Ejemplo n.º 10
0
    private bool FindDialogCanvas()
    {
        GameObject canvasObj = GameObject.FindGameObjectWithTag("DialogCanvas");

        if (canvasObj != null)
        {
            dialogCanvasInstance = canvasObj.GetComponent <DialogCanvas> ();
            return(true);
        }
        else
        {
            return(false);
        }
    }
Ejemplo n.º 11
0
 // Use this for initialization
 void Start()
 {
     dC = FindObjectOfType <DialogCanvas> ();
     if (textFile != null)
     {
         // Add each line of the text file to
         // the array using the new line
         // as the delimiter
         dialogLines = (textFile.text.Split('\n'));
     }
     for (int count = dialogLines.Length - 1; count >= 0; count--)
     {
     }
 }
Ejemplo n.º 12
0
 void Start()
 {
     canvasInScene = FindDialogCanvas();
     if (!canvasInScene)
     {
         dialogCanvasInstance = SpawnCanvas();
         canvasInScene        = dialogCanvasInstance != null;
     }
     if (canvasInScene)
     {
         HideDialogCanvas();
     }
     else
     {
         Debug.LogWarning("DialogManager/Start () : Coudn't find or spawn dialogCanvas in scene");
     }
 }
Ejemplo n.º 13
0
        public override void OnDrawNodeGUI(Rect rect, DialogCanvas canvas)
        {
            if (!canvas.definedPoints.ContainsKey(node.pointKey))
            {
                node.pointKey = "";
            }
            if (GUI.Button(rect, new GUIContent(node.pointKey == "" ? "-----" : node.pointKey), EditorStyles.popup))
            {
                List <string> keys = new List <string>(canvas.definedPoints.Keys);
                GenericMenu   menu = new GenericMenu();

                for (int k = 0; k < keys.Count; k++)
                {
                    menu.AddItem(new GUIContent(keys[k]), false, ChangeKey, keys[k]);
                }

                menu.DropDown(new Rect(0f, 16f, 0f, 0f));
            }
        }
        public override void OnDrawNodeGUI(Rect rect, DialogCanvas canvas)
        {
            EditorGUI.BeginChangeCheck();
            string newKey = EditorGUI.DelayedTextField(new Rect(0f, 0f, rect.width, 16f), node.pointKey.ToUpper().Replace(" ", "")).ToUpper().Replace(" ", "");

            if (EditorGUI.EndChangeCheck())
            {
                node.pointKey = node.pointKey.ToUpper().Replace(" ", "");
                newKey        = newKey.ToUpper().Replace(" ", "");
                if (newKey != "")
                {
                    if (canvas.definedPoints.ContainsKey(node.pointKey))
                    {
                        canvas.definedPoints.Remove(node.pointKey);
                    }
                    if (!canvas.definedPoints.ContainsKey(newKey))
                    {
                        canvas.definedPoints.Add(newKey, node);
                        node.isValid = true;
                    }
                    else
                    {
                        node.isValid = false;
                    }
                    node.pointKey = newKey.ToUpper().Replace(" ", "");
                }
            }

            if (!node.isValid && node.pointKey != "")
            {
                EditorGUI.LabelField(new Rect(0f, 16f, rect.width, 16f), new GUIContent("Already used"), GUI.skin.GetStyle("ErrorLabel"));
            }
            else if (node.pointKey == "")
            {
                EditorGUI.LabelField(new Rect(0f, 16f, rect.width, 16f), new GUIContent("Has to be set!"), GUI.skin.GetStyle("ErrorLabel"));
            }
        }
 void Start()
 {
     nextScene          = SceneMgr.Instance._currScene == SceneMgr.Scene.Dialog3 ? SceneMgr.Scene.Dialog4 : SceneMgr.Scene.UnitSelection;
     dialogController   = null;
     timelineController = FindObjectOfType <TimelineController>();
 }
 public void SetDialog(DialogCanvas dialog)
 {
     player.canvas = dialog;
 }