private static void CreateLayerAndLayerMask() { var layer_num_dic = InternalEditorUtility.layers.ToDictionary(layer => layer, layer => LayerMask.NameToLayer(layer)); var layer_mask_num_dic = InternalEditorUtility.layers.ToDictionary(layer => layer, layer => 1 << LayerMask.NameToLayer(layer)); ConstantsClassCreator.Create("LayerNumber", "レイヤー番号を定数管理するクラス", layer_num_dic, DIRECTORY_PATH, NAME_SPACE); ConstantsClassCreator.Create("LayerMaskNumber", "レイヤーマスク番号を定数管理するクラス", layer_mask_num_dic, DIRECTORY_PATH, NAME_SPACE); }
private static void CreateScene() { var scenes_name_dic = new Dictionary <string, string>(); for (int i = 0; i < EditorBuildSettings.scenes.Count(); i++) { var scene_name = Path.GetFileNameWithoutExtension(EditorBuildSettings.scenes[i].path); scenes_name_dic[scene_name] = scene_name; } ConstantsClassCreator.Create("SceneName", "シーン名を定数管理するクラス", scenes_name_dic, DIRECTORY_PATH, NAME_SPACE); }
private static void CreateInput() { var input_name_dic = new Dictionary <string, string>(); var serialized_obj = new SerializedObject(AssetDatabase.LoadAllAssetsAtPath(TARGET_DIRECTORY_NAME + INPUT_PATH)[0]); var axes_property = serialized_obj.FindProperty("m_Axes"); // InputManager.Asset内のm_Name情報を取得する for (int i = 0; i < axes_property.arraySize; ++i) { var axis_property = axes_property.GetArrayElementAtIndex(i); var name = GetChildProperty(axis_property, "m_Name").stringValue; input_name_dic[name] = name; } ConstantsClassCreator.Create("InputName", "インプット名を定数管理するクラス", input_name_dic, DIRECTORY_PATH, NAME_SPACE); }
private static void CreateSortingLayer() { var sorting_layer = GetSortingLayerNames().ToDictionary(value => value); ConstantsClassCreator.Create("SortingLayer", "ソーティングレイヤー名を定数管理するクラス", sorting_layer, DIRECTORY_PATH, NAME_SPACE); }
private static void CreateTags() { var tag_dic = InternalEditorUtility.tags.ToDictionary(value => value); ConstantsClassCreator.Create("TagName", "タグ名を定数管理するクラス", tag_dic, DIRECTORY_PATH, NAME_SPACE); }