public void OnStateSelected(CharacterStateNode _selectedNode) { if (m_copiedStateCache != null) { m_copiedStateCache.Cleanup(); m_copiedStateCache = null; } m_selectedNode = _selectedNode; PopulateStateDetailsView(_selectedNode.OwningSerializedObject); DisplayCopyPasteButton(); }
private void SetTemplateData(System.Enum _incEnum) { if (_incEnum.GetType() == typeof(E_NewCombatStateTemplate)) { E_NewCombatStateTemplate template = (E_NewCombatStateTemplate)_incEnum; m_copiedStateCache?.Cleanup(); m_copiedStateCache = new StateDataCache(); OTGEditorUtility.PopulateStateByTemplate(template, ref m_copiedStateCache, m_editorConfig); ContainerElement.Q <TextField>("new-state-name-textfield").value = template.ToString() + "template selected"; } }
private void OnPasteState() { string textBoxValue = ContainerElement.Q <TextField>("new-state-name-textfield").text; if (string.IsNullOrEmpty(textBoxValue)) { return; } CreateNewState(textBoxValue); m_copiedStateCache.Cleanup(); m_copiedStateCache = null; DisplayCopyPasteButton(); }
private void OnCopyState() { m_copiedStateCache = new StateDataCache(); m_copiedStateCache.CopyNode(m_selectedNode); DisplayCopyPasteButton(); }
private void PopulateStateWithStartingActionsAndTransitions(ref OTGCombatState _state, StateDataCache _data) { _data.PopulateState(ref _state); }
private static void CreateTwitchFighterStateTemplate(E_NewCombatStateTemplate _template, ref StateDataCache _cache, EditorConfig _config) { SerializedObject obj = new SerializedObject(AssetDatabase.LoadAssetAtPath <OTGCombatState>(_config.TemplatesPaths + "/" + _template.ToString() + ".asset")); _cache.CreateTemplate(obj); }
public static void PopulateStateByTemplate(E_NewCombatStateTemplate _stateTemplate, ref StateDataCache _cache, EditorConfig _config) { switch (CurrentCombatTemplate) { case E_CombatTemplate.TwitchFighter: CreateTwitchFighterStateTemplate(_stateTemplate, ref _cache, _config); break; case E_CombatTemplate.SideScrollBeatemUpWithLanes: break; } }