public UnityUIButtonTemplate AddButton(ButtonQuestContent button)
        {
            var instance = CreateInstance();

            instance.Assign(button.image, button.count, button.runtimeText, button.actionList);
            instance.groupNumber = button.groupNumber;
            return(instance);
        }
Exemple #2
0
 private void RemoveSubassets(ButtonQuestContent buttonQuestContent)
 {
     if (buttonQuestContent == null || buttonQuestContent.actionList == null)
     {
         return;
     }
     for (int i = 0; i < buttonQuestContent.actionList.Count; i++)
     {
         var content = buttonQuestContent.actionList[i];
         AssetUtility.DeleteFromAsset(content, QuestEditorWindow.selectedQuest);
     }
 }
        private static void ApplyButtonQuestContentProxyData(ButtonQuestContent buttonQuestContent, string s)
        {
            if (buttonQuestContent == null || s == null)
            {
                return;
            }
            var fields = s.Split(';');

            if (fields.Length < 4)
            {
                return;
            }
            buttonQuestContent.count          = SafeConvert.ToInt(fields[0]);
            buttonQuestContent.image          = string.IsNullOrEmpty(fields[1]) ? null : QuestMachine.GetImage(fields[1]);
            buttonQuestContent.originalText   = new StringField(fields[2]);
            buttonQuestContent.m_actionsProxy = JsonUtility.FromJson <QuestActionProxyContainer>(fields[3]);
        }
 private static string GetButtonQuestContentProxyData(ButtonQuestContent buttonQuestContent)
 {
     return(buttonQuestContent.count + ";" + ((buttonQuestContent.image != null) ? buttonQuestContent.image.name : string.Empty) + ";" +
            StringField.GetStringValue(buttonQuestContent.originalText) + ";" + JsonUtility.ToJson(buttonQuestContent.m_actionsProxy));
 }
Exemple #5
0
 protected virtual void AddButtonContent(ButtonQuestContent buttonContent)
 {
     PrepareButtonList();
     currentButtonList.AddButton(buttonContent);
 }