コード例 #1
0
 public NewCharacterSubView(EditorConfig _config, CharacterViewData _viewData) : base(_viewData, _config)
 {
     m_creationData    = new NewCharacterCreationData();
     m_creationFactory = new NewCharacterCreationFactory();
     CreateBreadcrumbs();
     PopulateNextBreadcrumb();
 }
コード例 #2
0
        public CharacterAnimationSubView(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig)
        {
            m_animationList = new List <SerializedProperty>();


            FindDataBoxes();
        }
コード例 #3
0
        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");
            }
        }
コード例 #4
0
        private void CreateCharacterSavedGraphFile(NewCharacterCreationData _data, EditorConfig _config)
        {
            CharacterSavedGraph savedGraph = ScriptableObject.CreateInstance <CharacterSavedGraph>();
            string path = _config.CharacterSavedGraphsPath + "/" + _data.CharacterName.ToString() + ".asset";

            AssetDatabase.CreateAsset(savedGraph, path);
        }
コード例 #5
0
 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);
 }
コード例 #6
0
 public static void RefreshProject(EditorConfig _config)
 {
     RegisterActions();
     RegisterTransitions();
     FindAllAnimationClips();
     FindAllActions(_config);
     FindAllTransitions(_config);
     FindAllAnimationEvents();
 }
コード例 #7
0
 public CharacterView(EditorConfig _editorConfig) : base()
 {
     m_config = _editorConfig;
     CreateNewData(m_config);
     //GetAllCharactersInScene();
     GatherVisualElements();
     CreateViews(_editorConfig);
     SwitchSubViews(m_charDetailsSubView);
 }
コード例 #8
0
 public static void SetCombatTemplate(E_CombatTemplate _template, EditorConfig _config)
 {
     CurrentCombatTemplate = _template;
     RegisterActions();
     RegisterTransitions();
     FindAllAnimationClips();
     FindAllActions(_config);
     FindAllTransitions(_config);
     FindAllAnimationEvents();
 }
コード例 #9
0
        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");
        }
コード例 #10
0
 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));
     }
 }
コード例 #11
0
        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();
        }
コード例 #12
0
 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;
     }
 }
コード例 #13
0
        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));
            }
        }
コード例 #14
0
        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();
        }
コード例 #15
0
        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();
        }
コード例 #16
0
        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();
        }
コード例 #17
0
 private void CreateNewData(EditorConfig _editorConfig)
 {
     m_viewData = new CharacterViewData(_editorConfig);
 }
コード例 #18
0
 public OptionsView(ref EditorConfig _config) : base()
 {
     m_viewData = new OptionsViewData(ref _config);
 }
コード例 #19
0
 public CharacterSubViewBase(CharacterViewData _charViewData, EditorConfig _editorConfig) : base() { m_charViewData = _charViewData; m_editorConfig = _editorConfig; }
コード例 #20
0
 public OptionsViewData(ref EditorConfig _editorConfig)
 {
     InitializeEditorConfig(ref _editorConfig);
     CreateEditorOptionsObject();
     CreateProperties();
 }
コード例 #21
0
        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);
        }
コード例 #22
0
        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;
            }
        }
コード例 #23
0
 public CharacterGraphSubview(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig)
 {
     m_animFilterField = m_containerElement.Q <TextField>("animation-filter");
 }
コード例 #24
0
 public CharacterDetailsSubView(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig)
 {
 }
コード例 #25
0
 private void LinkGlobalCombatConfig(NewCharacterCreationData _data, EditorConfig _config)
 {
     m_characterSMCObj.FindProperty("m_globalConfig").objectReferenceValue = _config.GlobalCombatConfig;
     m_characterSMCObj.ApplyModifiedProperties();
 }
コード例 #26
0
 public CharacterViewData(EditorConfig _editorConfig)
 {
     m_editorConfig    = _editorConfig;
     CharactersInScene = new List <OTGCombatSMC>();
 }
コード例 #27
0
 public CharacterStateSubview(CharacterViewData _charViewData, EditorConfig _editorConfig) : base(_charViewData, _editorConfig)
 {
 }