public NewCharacterSubView(EditorConfig _config, CharacterViewData _viewData) : base(_viewData, _config) { m_creationData = new NewCharacterCreationData(); m_creationFactory = new NewCharacterCreationFactory(); CreateBreadcrumbs(); PopulateNextBreadcrumb(); }
public CharacterAnimationSubView(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig) { m_animationList = new List <SerializedProperty>(); FindDataBoxes(); }
private static void FindAllTransitions(EditorConfig _editorConfig) { string[] transitionGuids = AssetDatabase.FindAssets("t:OTGTransitionDecision"); TransitionsInstantiated.Clear(); for (int i = 0; i < transitionGuids.Length; i++) { string assetPath = AssetDatabase.GUIDToAssetPath(transitionGuids[i]); TransitionsInstantiated.Add(AssetDatabase.LoadAssetAtPath <OTGTransitionDecision>(assetPath)); } for (int i = 0; i < TransitionsInstantiated.Count; i++) { for (int j = 0; j < TransitionsAvailable.Count; j++) { OTGTransitionDecision spawnInstance = TransitionsInstantiated[i]; OTGTransitionDecision spawnTransition = TransitionsAvailable[j]; if (spawnInstance.GetType() == spawnTransition.GetType()) { TransitionsAvailable.Remove(spawnTransition); } } } for (int k = 0; k < TransitionsAvailable.Count; k++) { OTGTransitionDecision act = TransitionsAvailable[k]; string[] splitFileName = act.GetType().ToString().Split('.'); AssetDatabase.CreateAsset(act, _editorConfig.CombatTransitionsPath + "/" + splitFileName[splitFileName.Length - 1] + ".asset"); } }
private void CreateCharacterSavedGraphFile(NewCharacterCreationData _data, EditorConfig _config) { CharacterSavedGraph savedGraph = ScriptableObject.CreateInstance <CharacterSavedGraph>(); string path = _config.CharacterSavedGraphsPath + "/" + _data.CharacterName.ToString() + ".asset"; AssetDatabase.CreateAsset(savedGraph, path); }
private void CreateViews(EditorConfig _editorConfig) { m_newCharacterSubView = new NewCharacterSubView(_editorConfig, m_viewData); m_charDetailsSubView = new CharacterDetailsSubView(m_viewData, _editorConfig); m_characterGraphSubView = new CharacterGraphSubview(m_viewData, _editorConfig); m_characterStateSubView = new CharacterStateSubview(m_viewData, _editorConfig); m_charAnimationSubview = new CharacterAnimationSubView(m_viewData, _editorConfig); }
public static void RefreshProject(EditorConfig _config) { RegisterActions(); RegisterTransitions(); FindAllAnimationClips(); FindAllActions(_config); FindAllTransitions(_config); FindAllAnimationEvents(); }
public CharacterView(EditorConfig _editorConfig) : base() { m_config = _editorConfig; CreateNewData(m_config); //GetAllCharactersInScene(); GatherVisualElements(); CreateViews(_editorConfig); SwitchSubViews(m_charDetailsSubView); }
public static void SetCombatTemplate(E_CombatTemplate _template, EditorConfig _config) { CurrentCombatTemplate = _template; RegisterActions(); RegisterTransitions(); FindAllAnimationClips(); FindAllActions(_config); FindAllTransitions(_config); FindAllAnimationEvents(); }
private void CreateCharacterDataFolders(NewCharacterCreationData _data, EditorConfig _config) { string rootCharfolder = OTGEditorUtility.GetCharacterRootFolder(_data.CharacterName, _config.CharacterPathRoot); AssetDatabase.CreateFolder(_config.CharacterPathRoot, _data.CharacterName); AssetDatabase.CreateFolder(rootCharfolder, "Configurations"); AssetDatabase.CreateFolder(rootCharfolder, "Prefabs"); AssetDatabase.CreateFolder(rootCharfolder, "States"); }
private void SetLayers(NewCharacterCreationData _data, EditorConfig _config) { if (_data.CharacterType == e_CombatantType.Player) { m_characterGameObject.layer = Mathf.RoundToInt(Mathf.Log(_config.GlobalCombatConfig.PlayerPushBox.value, 2)); m_hitColliderObj.gameObject.layer = Mathf.RoundToInt(Mathf.Log(_config.GlobalCombatConfig.PlayerHitBox.value, 2)); } else if (_data.CharacterType == e_CombatantType.Enemy) { m_characterGameObject.layer = Mathf.RoundToInt(Mathf.Log(_config.GlobalCombatConfig.EnemyPushBox.value, 2)); m_hitColliderObj.gameObject.layer = Mathf.RoundToInt(Mathf.Log(_config.GlobalCombatConfig.EnemyHitBox.value, 2)); } }
private void CreateAndAttachHandlerDataGroup(NewCharacterCreationData _data, EditorConfig _config) { HandlerDataGroup dataGrp = ScriptableObject.CreateInstance <HandlerDataGroup>(); dataGrp.name = _data.CharacterName + "_HanderDataGroup"; string path = OTGEditorUtility.GetCharacterConfigurationsFolder(_data.CharacterName, _config.CharacterPathRoot); AssetDatabase.CreateAsset(dataGrp, path + dataGrp.name + ".asset"); m_characterSMCObj.FindProperty("m_handlerDataGroup").objectReferenceValue = dataGrp; m_characterSMCObj.ApplyModifiedProperties(); }
private void InitializeEditorConfig(ref EditorConfig _config) { ConfigAsset = AssetDatabase.LoadAssetAtPath <EditorConfig>(m_editorConfigFile); if (ConfigAsset == null) { ConfigAsset = ScriptableObject.CreateInstance <EditorConfig>(); AssetDatabase.CreateAsset(ConfigAsset, m_editorConfigFile); _config = ConfigAsset; } else { _config = ConfigAsset; } }
public static void FindCharacterStates(string _characterName, EditorConfig _config) { // Find all Texture2Ds that have 'co' in their filename, that are labelled with 'architecture' and are placed in 'MyAwesomeProps' folder AvailableCharacterStates = new List <OTGCombatState>(); string searchString = _characterName + " t:OTGCombatState"; string folderName = GetCharacterStateFolder(_characterName, _config.CharacterPathRoot); string[] guids = AssetDatabase.FindAssets(searchString, new[] { folderName }); for (int i = 0; i < guids.Length; i++) { string path = AssetDatabase.GUIDToAssetPath(guids[i]); AvailableCharacterStates.Add(AssetDatabase.LoadAssetAtPath <OTGCombatState>(path)); } }
private void CreateInitialState(NewCharacterCreationData _data, EditorConfig _config) { OTGCombatState initialState = ScriptableObject.CreateInstance <OTGCombatState>(); initialState.name = OTGEditorUtility.GetCombatStateName(_data.CharacterName, "Inititial"); string stateFolder = OTGEditorUtility.GetCharacterStateFolder(_data.CharacterName, _config.CharacterPathRoot); string initialStateGUID = AssetDatabase.CreateFolder(stateFolder, "InitialState"); string initialStatePath = AssetDatabase.GUIDToAssetPath(initialStateGUID); AssetDatabase.CreateAsset(initialState, initialStatePath + "/" + initialState.name + ".asset"); m_characterSMCObj.FindProperty("m_startingState").objectReferenceValue = initialState; m_characterSMCObj.ApplyModifiedProperties(); }
public void CreateCharacterWithData(NewCharacterCreationData _data, EditorConfig _config) { CreateCharacterDataFolders(_data, _config); CreateCharacterGameObject(_data); CreateCharacterSavedGraphFile(_data, _config); AttachCombatSMC(); CreateAndAttachHandlerDataGroup(_data, _config); LinkGlobalCombatConfig(_data, _config); CreateInitialState(_data, _config); ApplyCharacterType(_data); ApplyCharacterModel(_data); AdjustCharacterControllerCapsule(); AddHitBoxCollider(); AddTargetingBox(_data, _config); AddSFXControllers(); SetLayers(_data, _config); FocusOnAddedCharacter(); Cleanup(); }
private void AddTargetingBox(NewCharacterCreationData _data, EditorConfig _config) { GameObject targeting = new GameObject(); m_targetingObj = targeting.AddComponent <OTGTargetingController>(); targeting.GetComponent <BoxCollider>().isTrigger = true; targeting.name = "TargetingController"; targeting.transform.parent = m_characterGameObject.transform; targeting.transform.position = new Vector3(1, 1, 0); SerializedObject obj = new SerializedObject(m_targetingObj); SerializedProperty prop = obj.FindProperty("m_validTargets"); if (_data.CharacterType == e_CombatantType.Player) { prop.intValue = _config.GlobalCombatConfig.EnemyPushBox; } if (_data.CharacterType == e_CombatantType.Enemy) { prop.intValue = _config.GlobalCombatConfig.PlayerPushBox; } obj.ApplyModifiedProperties(); }
private void CreateNewData(EditorConfig _editorConfig) { m_viewData = new CharacterViewData(_editorConfig); }
public OptionsView(ref EditorConfig _config) : base() { m_viewData = new OptionsViewData(ref _config); }
public CharacterSubViewBase(CharacterViewData _charViewData, EditorConfig _editorConfig) : base() { m_charViewData = _charViewData; m_editorConfig = _editorConfig; }
public OptionsViewData(ref EditorConfig _editorConfig) { InitializeEditorConfig(ref _editorConfig); CreateEditorOptionsObject(); CreateProperties(); }
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; } }
public CharacterGraphSubview(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig) { m_animFilterField = m_containerElement.Q <TextField>("animation-filter"); }
public CharacterDetailsSubView(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig) { }
private void LinkGlobalCombatConfig(NewCharacterCreationData _data, EditorConfig _config) { m_characterSMCObj.FindProperty("m_globalConfig").objectReferenceValue = _config.GlobalCombatConfig; m_characterSMCObj.ApplyModifiedProperties(); }
public CharacterViewData(EditorConfig _editorConfig) { m_editorConfig = _editorConfig; CharactersInScene = new List <OTGCombatSMC>(); }
public CharacterStateSubview(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig) { }