Advertisement
Guest User

Untitled

a guest
Nov 21st, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 22.20 KB | None | 0 0
  1. using Chronicles.Data.Mapping;
  2. using System;
  3. using System.Collections.Generic;
  4. using UnityEditor;
  5. using UnityEngine;
  6.  
  7. [CustomEditor(typeof(InteractableObject))]
  8. public class DynamicInteractableObjectEditor : Editor
  9. {
  10.     // Base data
  11.     private InteractableObject baseInteractable;
  12.  
  13.     // Foldouts
  14.     private bool _showItemInteractions = false;
  15.     private bool _showEntityStatModifications = false;
  16.     private bool _showStorytelling = false;
  17.     private bool _showSpecialInteractableBehaviour = false;
  18.  
  19.     // Reference to Interaction Sheet (Property)
  20.     private SerializedProperty _referencedInteractionSheetProp;
  21.     private InteractionSheet _referencedInteractionSheet;
  22.  
  23.     // Fetched DB data
  24.     private List<MappedItem> _dbItems;
  25.     private List<JournalEntry> _journalEntries;
  26.  
  27.     // Special Interactable Behaviour
  28.     private bool _resetInteractionCount = false;
  29.  
  30.     // Add Item
  31.     private bool _itemAddEnabled = false;
  32.     private int _selectedAddItemIndex;
  33.     private int _itemAddAmount = 0;
  34.  
  35.     // Remove Item
  36.     private bool _itemRemoveEnabled = false;
  37.     private int _selectedRemoveItemIndex;
  38.     private int _itemRemoveAmount = 0;
  39.  
  40.     // Entity Stats
  41.     private bool _restoreEntityHealthEnabled = false;
  42.     public float _restoreEntityHealthAmount = 0;
  43.     private float _drainEntityHealthAmount = 0;
  44.     private bool _drainEntityHealthEnabled = false;
  45.  
  46.     private float _restoreEntityStaminaAmount = 0;
  47.     private bool _restoreEntityStaminaEnabled = false;
  48.     private float _drainEntityStaminaAmount = 0;
  49.     private bool _drainEntityStaminaEnabled = false;
  50.  
  51.     private float _restoreEntitySatiationAmount = 0;
  52.     private bool _restoreEntitySatiationEnabled = false;
  53.     private float _drainEntitySatiationAmount = 0;
  54.     private bool _drainEntitySatiationEnabled = false;
  55.  
  56.     // Storytelling
  57.     private int _selectedJournalEntry = 0;
  58.     private bool _journalEntryEnabled = false;
  59.  
  60.     private void OnEnable()
  61.     {
  62.         // Fetch serialized property of Interaction Sheet
  63.         if (serializedObject != null && (this._referencedInteractionSheetProp = serializedObject.FindProperty("interactionSheet")) != null)
  64.         {
  65.             this._referencedInteractionSheet = this._referencedInteractionSheetProp.objectReferenceValue as InteractionSheet;
  66.         }
  67.  
  68.         // Initial refreshing of data
  69.         if (ChroniclesDatabaseWindow.Instance.IsConnected || ChroniclesDatabaseWindow.Instance.AutoConnect())
  70.         {
  71.             RefreshData();
  72.         }
  73.  
  74.         // Get base interactable
  75.         this.baseInteractable = target as InteractableObject;
  76.     }
  77.  
  78.     public override void OnInspectorGUI()
  79.     {
  80.         DrawDefaultInspector();
  81.  
  82.         // Main Header
  83.         EditorUtils.Header("Dynamic Interaction");
  84.        
  85.         // Interaction Sheet
  86.         this.DrawInteractionSheetReferenceField();
  87.  
  88.         // Will disable all controls when no Interaction Sheet is loaded
  89.         EditorGUI.BeginDisabledGroup(!this._referencedInteractionSheetProp.objectReferenceValue);
  90.         {
  91.             // Special Interactable Behaviour
  92.             EditorGUILayout.Space();
  93.             this.DrawSpecialBehavior();
  94.  
  95.             // Item Selection
  96.             EditorGUILayout.Space();
  97.             this.DrawItemSelectionEditor();
  98.  
  99.             // Entity Stats
  100.             EditorGUILayout.Space();
  101.             this.DrawEntityStatsEditor();
  102.  
  103.             // Storytelling
  104.             EditorGUILayout.Space();
  105.             this.DrawStorytellingEditor();
  106.  
  107.             // Save and Refresh Buttons
  108.             EditorGUILayout.Space();
  109.             this.DrawControlButtons();
  110.  
  111.             // Will disable all controls when no Interaction Sheet is loaded
  112.             EditorGUI.EndDisabledGroup();
  113.         }
  114.     }
  115.  
  116.     private void DrawSpecialBehavior()
  117.     {
  118.         // Storytelling foldout
  119.         this._showSpecialInteractableBehaviour = EditorGUILayout.Foldout(EditorPrefs.GetBool("DIOE_Foldout_SpecialInteractableBehaviour", true), "Special Interactable Behaviour", true, EditorStyles.foldout);
  120.         if (this._showSpecialInteractableBehaviour != EditorPrefs.GetBool("DIOE_Foldout_SpecialInteractableBehaviour", true))
  121.         {
  122.             EditorPrefs.SetBool("DIOE_Foldout_SpecialInteractableBehaviour", this._showSpecialInteractableBehaviour);
  123.         }
  124.  
  125.         // If foldout is opened, display Storytelling controls
  126.         EditorGUILayout.BeginHorizontal();
  127.         EditorGUI.BeginDisabledGroup(!ChroniclesDatabaseWindow.Instance.IsConnected);
  128.         if (this._showSpecialInteractableBehaviour)
  129.         {
  130.             // Auto-Reset of interaction within a specific or random (between two constants) amount of time
  131.             EditorGUILayout.BeginHorizontal();
  132.             EditorGUI.BeginDisabledGroup(this.baseInteractable.OneTimeInteraction);
  133.             this._resetInteractionCount = EditorGUILayout.Toggle("Reset Interaction", this._resetInteractionCount); // TODO <- Continue here
  134.             EditorGUI.EndDisabledGroup();
  135.             EditorGUILayout.EndHorizontal();
  136.         }
  137.         EditorGUI.EndDisabledGroup();
  138.         EditorGUILayout.EndHorizontal();
  139.     }
  140.  
  141.     private void DrawInteractionSheetReferenceField()
  142.     {
  143.         SerializedProperty oldReferencedInteractionSheetProp = this._referencedInteractionSheetProp;
  144.  
  145.         EditorGUILayout.BeginHorizontal();
  146.  
  147.         // Object Field (-> Interaction Sheet)
  148.         EditorGUILayout.ObjectField(this._referencedInteractionSheetProp, typeof(InteractionSheet));
  149.  
  150.         // Create Button
  151.         EditorGUI.BeginDisabledGroup(this._referencedInteractionSheetProp.objectReferenceValue);
  152.         if (GUILayout.Button("Create", GUILayout.Width(60.0f)))
  153.         {
  154.             this._referencedInteractionSheetProp.objectReferenceValue = InteractionSheetCreator.CreateSheet();
  155.         }
  156.         EditorGUI.EndDisabledGroup();
  157.  
  158.         // Delete Button
  159.         EditorGUI.BeginDisabledGroup(!this._referencedInteractionSheetProp.objectReferenceValue);
  160.         if (GUILayout.Button("Delete", GUILayout.Width(60.0f)))
  161.         {
  162.             string assetPath = InteractionSheetCreator.TARGET_PATH + "/" + this._referencedInteractionSheetProp.objectReferenceValue.name + ".asset";
  163.             this._referencedInteractionSheetProp.objectReferenceValue = null;
  164.             DestroyImmediate(AssetDatabase.LoadAssetAtPath<InteractionSheet>(assetPath), true);
  165.         }
  166.         EditorGUI.EndDisabledGroup();
  167.  
  168.         // Save Interaction Sheet Reference if changes were made
  169.         if (oldReferencedInteractionSheetProp != this._referencedInteractionSheetProp)
  170.         {
  171.             if (serializedObject.ApplyModifiedProperties())
  172.             {
  173.                 Debug.Log("Interaction Sheet was updated on " + this.baseInteractable.gameObject.name);
  174.             } else
  175.             {
  176.                 Debug.LogError("Failed to update Interaction Sheet on " + this.baseInteractable.gameObject.name);
  177.             }
  178.         }
  179.  
  180.         EditorGUILayout.EndHorizontal();
  181.     }
  182.  
  183.     private void DrawItemSelectionEditor()
  184.     {
  185.         // Items foldout
  186.         this._showItemInteractions = EditorGUILayout.Foldout(EditorPrefs.GetBool("DIOE_Foldout_Items", true), "Adding / Removing Items from Inventory", true, EditorStyles.foldout);
  187.         if (this._showItemInteractions != EditorPrefs.GetBool("DIOE_Foldout_Items", true))
  188.         {
  189.             EditorPrefs.SetBool("DIOE_Foldout_Items", this._showItemInteractions);
  190.         }
  191.  
  192.         // If foldout is opened, display add / remove item controls
  193.         if (this._showItemInteractions)
  194.         {
  195.             // Items Add / Remove is only available if a database connection is established
  196.             EditorGUI.BeginDisabledGroup(!ChroniclesDatabaseWindow.Instance.IsConnected);
  197.             GUILayout.BeginHorizontal();
  198.  
  199.             // Add Item Dropdown
  200.             GUIContent addItemLabel = new GUIContent("Add Item");
  201.             if (ChroniclesDatabaseWindow.Instance.IsConnected)
  202.             {
  203.                 this._selectedAddItemIndex = EditorGUILayout.Popup(addItemLabel, this._selectedAddItemIndex, this._dbItems.ToArray());
  204.             }
  205.             else
  206.             {
  207.                 EditorGUILayout.Popup(addItemLabel, 0, new string[] { "<Not connected>" });
  208.             }
  209.  
  210.             // Add Item Amount
  211.             this._itemAddAmount = EditorGUILayout.IntField(this._itemAddAmount, GUILayout.Width(60.0f));
  212.             this._itemAddEnabled = EditorGUILayout.Toggle(this._itemAddEnabled, GUILayout.Width(20.0f));
  213.             GUILayout.EndHorizontal();
  214.  
  215.             // Remove Item Dropdown
  216.             GUILayout.BeginHorizontal();
  217.             GUIContent removeItemLabel = new GUIContent("Remove Item");
  218.             if (ChroniclesDatabaseWindow.Instance.IsConnected)
  219.             {
  220.                 this._selectedRemoveItemIndex = EditorGUILayout.Popup(removeItemLabel, this._selectedRemoveItemIndex, this._dbItems.ToArray());
  221.             }
  222.             else
  223.             {
  224.                 EditorGUILayout.Popup(removeItemLabel, 0, new string[] { "<Not connected>" });
  225.             }
  226.  
  227.             // Add Item Amount
  228.             this._itemRemoveAmount = EditorGUILayout.IntField(this._itemRemoveAmount, GUILayout.Width(60.0f));
  229.             this._itemRemoveEnabled = EditorGUILayout.Toggle(this._itemRemoveEnabled, GUILayout.Width(20.0f));
  230.             GUILayout.EndHorizontal();
  231.             EditorGUI.EndDisabledGroup();
  232.         }
  233.  
  234.         // Item amount input validation
  235.         if (this._itemAddAmount < 0)
  236.         {
  237.             this._itemAddAmount = 0;
  238.         }
  239.  
  240.         if (this._itemRemoveAmount < 0)
  241.         {
  242.             this._itemRemoveAmount = 0;
  243.         }
  244.     }
  245.  
  246.     private void DrawEntityStatsEditor()
  247.     {
  248.         // Entity Stat foldout
  249.         this._showEntityStatModifications = EditorGUILayout.Foldout(EditorPrefs.GetBool("DIOE_Foldout_EntityStats", true), "Entity Stat Modification", true, EditorStyles.foldout);
  250.         if (this._showEntityStatModifications != EditorPrefs.GetBool("DIOE_Foldout_EntityStats", true))
  251.         {
  252.             EditorPrefs.SetBool("DIOE_Foldout_EntityStats", this._showEntityStatModifications);
  253.         }
  254.  
  255.         // If foldout is opened, display Entity Stat modification controls
  256.         if (this._showEntityStatModifications)
  257.         {
  258.             // Restore Health
  259.             EditorGUILayout.BeginHorizontal();
  260.             this._restoreEntityHealthAmount = EditorGUILayout.FloatField(new GUIContent("Restore Health"), this._restoreEntityHealthAmount);
  261.             this._restoreEntityHealthEnabled = EditorGUILayout.Toggle(this._restoreEntityHealthEnabled, GUILayout.Width(20.0f));
  262.             EditorGUILayout.EndHorizontal();
  263.  
  264.             // Drain Health
  265.             EditorGUILayout.BeginHorizontal();
  266.             this._drainEntityHealthAmount = EditorGUILayout.FloatField(new GUIContent("Drain Health"), this._drainEntityHealthAmount);
  267.             this._drainEntityHealthEnabled = EditorGUILayout.Toggle(this._drainEntityHealthEnabled, GUILayout.Width(20.0f));
  268.             EditorGUILayout.EndHorizontal();
  269.  
  270.             // Restore Stamina
  271.             EditorGUILayout.BeginHorizontal();
  272.             this._restoreEntityStaminaAmount = EditorGUILayout.FloatField(new GUIContent("Restore Stamina"), this._restoreEntityStaminaAmount);
  273.             this._restoreEntityStaminaEnabled = EditorGUILayout.Toggle(this._restoreEntityStaminaEnabled, GUILayout.Width(20.0f));
  274.             EditorGUILayout.EndHorizontal();
  275.  
  276.             // Drain Stamina
  277.             EditorGUILayout.BeginHorizontal();
  278.             this._drainEntityStaminaAmount = EditorGUILayout.FloatField(new GUIContent("Drain Stamina"), this._drainEntityStaminaAmount);
  279.             this._drainEntityStaminaEnabled = EditorGUILayout.Toggle(this._drainEntityStaminaEnabled, GUILayout.Width(20.0f));
  280.             EditorGUILayout.EndHorizontal();
  281.  
  282.             // Restore Satiation
  283.             EditorGUILayout.BeginHorizontal();
  284.             this._restoreEntitySatiationAmount = EditorGUILayout.FloatField(new GUIContent("Restore Satiation"), this._restoreEntitySatiationAmount);
  285.             this._restoreEntitySatiationEnabled = EditorGUILayout.Toggle(this._restoreEntitySatiationEnabled, GUILayout.Width(20.0f));
  286.             EditorGUILayout.EndHorizontal();
  287.  
  288.             // Drain Satiation
  289.             EditorGUILayout.BeginHorizontal();
  290.             this._drainEntitySatiationAmount = EditorGUILayout.FloatField(new GUIContent("Drain Satiation"), this._drainEntitySatiationAmount);
  291.             this._drainEntitySatiationEnabled = EditorGUILayout.Toggle(this._drainEntitySatiationEnabled, GUILayout.Width(20.0f));
  292.             EditorGUILayout.EndHorizontal();
  293.  
  294.             // Input validation
  295.             if (this._restoreEntityHealthAmount < 0)
  296.             {
  297.                 this._restoreEntityHealthAmount = 0;
  298.             }
  299.  
  300.             if (this._drainEntityHealthAmount < 0)
  301.             {
  302.                 this._drainEntityHealthAmount = 0;
  303.             }
  304.  
  305.             if (this._restoreEntityStaminaAmount < 0)
  306.             {
  307.                 this._restoreEntityStaminaAmount = 0;
  308.             }
  309.  
  310.             if (this._drainEntityStaminaAmount < 0)
  311.             {
  312.                 this._drainEntityStaminaAmount = 0;
  313.             }
  314.  
  315.             if (this._restoreEntitySatiationAmount < 0)
  316.             {
  317.                 this._restoreEntitySatiationAmount = 0;
  318.             }
  319.  
  320.             if (this._drainEntitySatiationAmount < 0)
  321.             {
  322.                 this._drainEntitySatiationAmount = 0;
  323.             }
  324.         }
  325.     }
  326.  
  327.     private void DrawStorytellingEditor()
  328.     {
  329.         // Storytelling foldout
  330.         this._showStorytelling = EditorGUILayout.Foldout(EditorPrefs.GetBool("DIOE_Foldout_Storytelling", true), "Storytelling", true, EditorStyles.foldout);
  331.         if (this._showStorytelling != EditorPrefs.GetBool("DIOE_Foldout_Storytelling", true))
  332.         {
  333.             EditorPrefs.SetBool("DIOE_Foldout_Storytelling", this._showStorytelling);
  334.         }
  335.  
  336.         // If foldout is opened, display Storytelling controls
  337.         EditorGUILayout.BeginHorizontal();
  338.         EditorGUI.BeginDisabledGroup(!ChroniclesDatabaseWindow.Instance.IsConnected);
  339.         if (this._showStorytelling)
  340.         {
  341.             this._selectedJournalEntry = this.DrawJournalEntryPopup("Trigger Journal Entry", this._selectedJournalEntry);
  342.             this._journalEntryEnabled = EditorGUILayout.Toggle(this._journalEntryEnabled, GUILayout.Width(20.0f));
  343.         }
  344.         EditorGUI.EndDisabledGroup();
  345.         EditorGUILayout.EndHorizontal();
  346.     }
  347.  
  348.     private void DrawControlButtons()
  349.     {
  350.         // Save Changes Button
  351.         EditorGUILayout.BeginHorizontal();
  352.         if (GUILayout.Button("Save Changes"))
  353.         {
  354.             this.SaveProperties();
  355.         }
  356.  
  357.         // Refresh from DB Button
  358.         if (GUILayout.Button("Refresh from DB"))
  359.         {
  360.             this.RefreshFromDB();
  361.         }
  362.         EditorGUILayout.EndHorizontal();
  363.     }
  364.  
  365.     private int DrawJournalEntryPopup(string label, int selectedIndex, params GUILayoutOption[] options)
  366.     {
  367.         if (ChroniclesDatabaseWindow.Instance.IsConnected)
  368.         {
  369.             selectedIndex = EditorGUILayout.Popup(label, selectedIndex, this._journalEntries.ConvertAll(j => j.Title).ToArray(), options);
  370.         } else
  371.         {
  372.             EditorGUI.BeginDisabledGroup(true);
  373.             EditorGUILayout.Popup(0, new string[] { "<Not connected>" });
  374.             EditorGUI.EndDisabledGroup();
  375.         }
  376.  
  377.         return selectedIndex;
  378.     }
  379.  
  380.     private void SaveProperties()
  381.     {
  382.         if (_referencedInteractionSheet)
  383.         {
  384.             if (ChroniclesDatabaseWindow.Instance.IsConnected && this._dbItems != null && this._dbItems.Count > 0)
  385.             {
  386.                 this._referencedInteractionSheet.enableItemAdding = this._itemAddEnabled;
  387.                 this._referencedInteractionSheet.itemToBeAddedAmount = this._itemAddAmount;
  388.                 if (this._selectedAddItemIndex < 0 || this._selectedAddItemIndex >= this._dbItems.Count)
  389.                 {
  390.                     this._selectedAddItemIndex = 0;
  391.                     this._itemAddEnabled = false;
  392.                 }
  393.                 this._referencedInteractionSheet.itemToBeAdded = this._dbItems[this._selectedAddItemIndex].item.ID;
  394.  
  395.                 this._referencedInteractionSheet.enableItemRemoval = this._itemRemoveEnabled;
  396.                 this._referencedInteractionSheet.itemToBeRemovedAmount = this._itemRemoveAmount;
  397.                 if (this._selectedRemoveItemIndex < 0 || this._selectedRemoveItemIndex >= this._dbItems.Count)
  398.                 {
  399.                     this._selectedRemoveItemIndex = 0;
  400.                     this._itemRemoveEnabled = false;
  401.                 }
  402.                 this._referencedInteractionSheet.itemToBeRemoved = this._dbItems[this._selectedRemoveItemIndex].item.ID;
  403.             }
  404.  
  405.             // Storytelling - Journal Entry
  406.             if (this._journalEntries != null && this._journalEntries.Count > 0)
  407.             {
  408.                 if (this._selectedJournalEntry >= this._journalEntries.Count || this._selectedJournalEntry < 0)
  409.                 {
  410.                     this._selectedJournalEntry = 0;
  411.                     this._journalEntryEnabled = false;
  412.                 }
  413.  
  414.                 int journalEntryID = this._journalEntries[this._selectedJournalEntry].ID;
  415.  
  416.                 this._referencedInteractionSheet.addJournalEntryID = journalEntryID;
  417.                 this._referencedInteractionSheet.enableJournalEntry = this._journalEntryEnabled;
  418.             }
  419.  
  420.             this._referencedInteractionSheet.enableHealthRestore = this._restoreEntityHealthEnabled;
  421.             this._referencedInteractionSheet.enableHealthDrain = this._drainEntityHealthEnabled;
  422.             this._referencedInteractionSheet.enableStaminaRestore = this._restoreEntityStaminaEnabled;
  423.             this._referencedInteractionSheet.enableStaminaDrain = this._drainEntityStaminaEnabled;
  424.             this._referencedInteractionSheet.enableSatiationRestore = this._restoreEntitySatiationEnabled;
  425.             this._referencedInteractionSheet.enableSatiationDrain = this._drainEntitySatiationEnabled;
  426.  
  427.             this._referencedInteractionSheet.healthToRestore = this._restoreEntityHealthAmount;
  428.             this._referencedInteractionSheet.staminaToRestore = this._restoreEntityStaminaAmount;
  429.             this._referencedInteractionSheet.satiationToRestore = this._restoreEntitySatiationAmount;
  430.  
  431.             this._referencedInteractionSheet.healthToDrain = this._drainEntityHealthAmount;
  432.             this._referencedInteractionSheet.staminaToDrain = this._drainEntityStaminaAmount;
  433.             this._referencedInteractionSheet.satiationToDrain = this._drainEntitySatiationAmount;
  434.  
  435.             // Save Data!
  436.             if (serializedObject.ApplyModifiedProperties())
  437.             {
  438.                 Debug.Log("Interaction Sheet was saved for GameObject " + this.baseInteractable.gameObject.name);
  439.             } else
  440.             {
  441.                 Debug.LogError("Failed to save Interaction Sheet of GameObject " + this.baseInteractable.gameObject.name);
  442.             }
  443.         }
  444.     }
  445.  
  446.     public void RefreshFromDB()
  447.     {
  448.         this._journalEntries = ChroniclesDatabaseWindow.Instance.Database.JournalDatabase.GetAllJournalEntries();
  449.         this._dbItems = ChroniclesDatabaseWindow.Instance.Database.ItemDatabase.GetAllItems().ConvertAll(i => new MappedItem()
  450.         {
  451.             item = i,
  452.             text = i.Name
  453.         });
  454.     }
  455.  
  456.     public void RefreshData()
  457.     {
  458.         if (!ChroniclesDatabaseWindow.Instance || !ChroniclesDatabaseWindow.Instance.IsConnected)
  459.         {
  460.             return;
  461.         }
  462.  
  463.         RefreshFromDB();
  464.        
  465.         if (this._referencedInteractionSheet)
  466.         {
  467.             // Retrieve from DB
  468.             this._selectedAddItemIndex = this._dbItems.FindIndex(i => i.item.ID == this._referencedInteractionSheet.itemToBeAdded);
  469.             this._selectedRemoveItemIndex = this._dbItems.FindIndex(i => i.item.ID == this._referencedInteractionSheet.itemToBeRemoved);
  470.             this._selectedJournalEntry = this._journalEntries.FindIndex(j => j.ID == this._referencedInteractionSheet.addJournalEntryID);
  471.  
  472.             // Fix dropdown index
  473.             if (this._selectedAddItemIndex < 0)
  474.             {
  475.                 this._selectedAddItemIndex = 0;
  476.             }
  477.  
  478.             if (this._selectedRemoveItemIndex < 0)
  479.             {
  480.                 this._selectedRemoveItemIndex = 0;
  481.             }
  482.  
  483.             if (this._selectedJournalEntry < 0)
  484.             {
  485.                 this._selectedJournalEntry = 0;
  486.             }
  487.        
  488.             // Get initial values (DB independent)
  489.             this._itemAddEnabled = this._referencedInteractionSheet.enableItemAdding;
  490.             this._itemRemoveEnabled = this._referencedInteractionSheet.enableItemRemoval;
  491.  
  492.             this._itemAddAmount = this._referencedInteractionSheet.itemToBeAddedAmount;
  493.             this._itemRemoveAmount = this._referencedInteractionSheet.itemToBeRemovedAmount;
  494.  
  495.             this._restoreEntityHealthEnabled = this._referencedInteractionSheet.enableHealthRestore;
  496.             this._restoreEntityStaminaEnabled = this._referencedInteractionSheet.enableStaminaRestore;
  497.             this._restoreEntitySatiationEnabled = this._referencedInteractionSheet.enableSatiationRestore;
  498.  
  499.             this._drainEntityHealthEnabled = this._referencedInteractionSheet.enableHealthDrain;
  500.             this._drainEntityStaminaEnabled = this._referencedInteractionSheet.enableStaminaDrain;
  501.             this._drainEntitySatiationEnabled = this._referencedInteractionSheet.enableSatiationDrain;
  502.  
  503.             this._restoreEntityHealthAmount = this._referencedInteractionSheet.healthToRestore;
  504.             this._restoreEntityStaminaAmount = this._referencedInteractionSheet.staminaToRestore;
  505.             this._restoreEntitySatiationAmount = this._referencedInteractionSheet.satiationToRestore;
  506.  
  507.             this._drainEntityHealthAmount = this._referencedInteractionSheet.healthToDrain;
  508.             this._drainEntityStaminaAmount = this._referencedInteractionSheet.staminaToDrain;
  509.             this._drainEntitySatiationAmount = this._referencedInteractionSheet.satiationToDrain;
  510.  
  511.             this._journalEntryEnabled = this._referencedInteractionSheet.enableJournalEntry;
  512.         }
  513.     }
  514. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement