public override void OnInspectorGUI() { TableNPCNPCDialogScriptable script = (TableNPCNPCDialogScriptable)target; if (GUILayout.Button("Update")) { script.LoadGameTable(true); } GUILayout.Space(20); DrawDefaultInspector(); }
public static TableNPCNPCDialogScriptable Get() { TableNPCNPCDialogScriptable t = ClientDataBaseManager.Instance.GetLoadedTable <TableNPCNPCDialogScriptable>(); if (t == null) { ScriptableObjectBase scriptable = ClientDataBaseManager.Instance.LoadTable(m_gameTableName); ClientDataBaseManager.Instance.Register(typeof(TableNPCNPCDialogScriptable), scriptable); return(ClientDataBaseManager.Instance.GetLoadedTable <TableNPCNPCDialogScriptable>()); } return(t); }
private void SetDialogInfo(int dialogId) { var data = TableNPCNPCDialogScriptable.Get().GetData(dialogId); if (data != null) { Text_Dialog.text = data.content; TypewriterText.RestartRead(); if (data.Speaker != "我") { Image_LeftSide.gameObject.SetActive(false); Image_RightSide.gameObject.SetActive(true); Image_RightSide.sprite = Sprte_speaker[1]; } else { Image_LeftSide.gameObject.SetActive(true); Image_RightSide.gameObject.SetActive(false); Image_LeftSide.sprite = Sprte_speaker[0]; } } }