public static void CreateConversationData() { ScriptableObjectUtility.CreateAsset <ConversationData>(); }
private static void FactoryConfig() { ScriptableObjectUtility.CreateAsset <AvatarConfig>(); }
public static void CreateDialogueLine() { ScriptableObjectUtility.CreateAsset <MRFBetaExperimentSettings>(); }
public static void CreateParam() { var path = "Assets/Quests/Params Register/"; ScriptableObjectUtility.CreateAsset <ParamsData>(path); }
public static void CreateQuest() { var path = "Assets/Quests/Quest Register/"; ScriptableObjectUtility.CreateAsset <QuestData>(path); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <LanguageData> (); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <Recipe>(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <YourClass>(); }
static public void CreateItem() { ScriptableObjectUtility.CreateAsset <BaseItem>(); }
public static void CreateTile() { ScriptableObjectUtility.CreateAsset <_5x5Tile>(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <ForcePrec_SO>(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <HeroDataList> (); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <Bullet>(); }
public static void CreateAbilityCatalogRecipe() { ScriptableObjectUtility.CreateAsset <AbilityCatalogRecipe>(); }
public static void CreateAsset() { var newCurrency = ScriptableObjectUtility.CreateAsset <WalletCurrency>("Assets/HigherOrLower/Wallet/Currencies/"); newCurrency.Setup(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <RangeWeaponData>(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <ItemData> (); }
public static void CreateScriptableObject() { ScriptableObjectUtility.CreateAsset <Throwable>(); }
private void OnDestroy() { ScriptableObjectUtility.RemoveScriptableObjectFromPreloadedAssets(AllSavesData.Instance); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <DynamicEvent> (); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <CharacterInfo> (); }
static void NewCameraStateData() { ScriptableObjectUtility.CreateAsset <TPCameraListData>(); }
public static void CreateNodeWindow() { var path = "Assets/saveWindow/"; ScriptableObjectUtility.CreateAsset <Node>(path); }
public static void Create() { ScriptableObjectUtility.CreateAsset <ShowInteractableReaction>(); }
public static void CreateDialogues() { ScriptableObjectUtility.CreateAsset <UnitsTable>(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <EquipmentBlueprint>(); }
public static void CreateAsset() { ScriptableObjectUtility.CreateAsset <EnvObjPrefabData> (); }
private void CreateMesh() { Sprite sprite = spriteRenderer.sprite; Rect bounds = GetBounds(polygon); TriangleNet.Mesh tnMesh = new TriangleNet.Mesh(); TriangleNet.Geometry.InputGeometry input = new TriangleNet.Geometry.InputGeometry(); input.AddPolygon(polygon); tnMesh.Triangulate(input); Mesh mesh = new Mesh(); mesh.vertices = tnMesh.Vertices.Select(p => new Vector3((float)p.X, (float)p.Y, 0)).ToArray(); // Not sure about winding // If there is an interesting error, It is probably because of cw/ccw windings int[] tris = tnMesh.Triangles.ToUnityMeshTriangleIndices(); mesh.triangles = tris; List <Vector2> uv = new List <Vector2>(); Vector3 lower = new Vector3(bounds.x, bounds.y); Vector3 size = new Vector3(bounds.xMax, bounds.yMax) - lower; Rect uv_bounds = new Rect(sprite.rect.x / sprite.texture.width, sprite.rect.y / sprite.texture.height, sprite.rect.width / sprite.texture.width, sprite.rect.height / sprite.texture.height); float scalex = sprite.bounds.size.x / bounds.width; float scaley = sprite.bounds.size.y / bounds.height; Vector3[] scaled = mesh.vertices; for (int i = 0; i < mesh.vertices.Length; i++) { Vector3 v = scaled[i]; Vector3 rel = v - lower; uv.Add(new Vector2(rel.x / size.x * uv_bounds.width, rel.y / size.y * uv_bounds.height) + new Vector2(uv_bounds.x, uv_bounds.y)); scaled[i] = new Vector3(v.x * scalex, v.y * scaley, v.z) - ((Vector3)bounds.center * scalex) + sprite.bounds.center; } mesh.MarkDynamic(); mesh.vertices = scaled; mesh.uv = uv.ToArray(); mesh.RecalculateNormals(); mesh.RecalculateBounds(); mesh.Optimize(); //GameObject go = new GameObject(); //MeshFilter mf = go.AddComponent<MeshFilter>(); //mf.sharedMesh = mesh; //MeshRenderer mr = go.AddComponent<MeshRenderer>(); //mr.sharedMaterial = spriteRenderer.sharedMaterial; // Check if the Meshes directory exists, if not, create it. DirectoryInfo meshDir = new DirectoryInfo("Assets/Meshes"); if (Directory.Exists(meshDir.FullName) == false) { Directory.CreateDirectory(meshDir.FullName); } ScriptableObjectUtility.CreateAsset(mesh, "Meshes/" + spriteRenderer.gameObject.name + ".Mesh"); }
public void SaveMap() { if (pathsSaved == null) { return; } _mapName = EditorGUILayout.TextField("Map name", _mapName); if (String.IsNullOrEmpty(_mapName)) { EditorGUILayout.HelpBox("Name field is empty!", MessageType.Warning); } if (CheckIfNameExist(_mapName, _fullPath)) { EditorGUILayout.HelpBox("That name is already in use!", MessageType.Warning); } EditorGUILayout.LabelField("Path Selected: " + _fullPath); if (!CheckPathSelected()) { EditorGUILayout.HelpBox("Select the folder where you wish to save the map!", MessageType.Warning); } EditorGUILayout.LabelField("Total polygons: " + pathsSaved.totalPolygons); if (GUILayout.Button("Select folder")) { string tempPathSeparated = ""; _path = EditorUtility.OpenFolderPanel("Select folder", "Assets/", string.Empty); tempPathSeparated = _path.Split(new[] { "/" }, StringSplitOptions.None).Last(); if (tempPathSeparated == "Assets") { _path = _path + "/"; } _fullPath = _path; if (!String.IsNullOrEmpty(_path)) { _path = _path.Split(new[] { "Assets/" }, StringSplitOptions.None)[1]; } Repaint(); } if (GUILayout.Button("Save map")) { List <string> tempPath = new List <string>(); if (CheckPathSelected()) { if (!String.IsNullOrEmpty(_mapName)) { if (!CheckIfNameExist(_mapName, _fullPath)) { if (pathsSaved.paths.Count > 0) { ScriptableObjectUtility.CreateAsset <MapsSaved>(_path + "/" + _mapName); var asset = AssetDatabase.FindAssets("t:MapsSaved", null); MapsSaved currentMap = null; for (int i = asset.Length - 1; i >= 0; i--) { //obtengo todo el path string path = AssetDatabase.GUIDToAssetPath(asset[i]); //separo las diferentes carpetas por el carcater / tempPath = path.Split('/').ToList(); if (!String.IsNullOrEmpty(_path)) { if (path == "Assets/" + _path + "/" + _mapName + ".asset") { if (File.Exists(_fullPath + "/" + tempPath.Last())) { currentMap = AssetDatabase.LoadAssetAtPath <MapsSaved>("Assets/" + _path + "/" + _mapName + ".asset"); _seed.mapNameLoaded = _mapName; _seed.mapLoaded = true; _seed.currentMap = currentMap; _seed.mapLoadedIndex = i; break; } } } else { if (path == "Assets/" + _mapName + ".asset") { if (File.Exists(_fullPath + "/" + tempPath.Last())) { currentMap = AssetDatabase.LoadAssetAtPath <MapsSaved>("Assets/" + _mapName + ".asset"); _seed.mapNameLoaded = _mapName; _seed.mapLoaded = true; _seed.currentMap = currentMap; _seed.mapLoadedIndex = i; break; } } } } if (currentMap != null) { currentMap.paths.AddRange(pathsSaved.paths); currentMap.objectType.AddRange(pathsSaved.objectType); currentMap.positions.AddRange(pathsSaved.positions); currentMap.rotations.AddRange(pathsSaved.rotations); currentMap.vessels.AddRange(pathsSaved.vessels); currentMap.VesselsType.AddRange(pathsSaved.vesselsType); currentMap.vesselsPositions.AddRange(pathsSaved.vesselsPositions); currentMap.vesselsDistance.AddRange(pathsSaved.vesselsDistance); currentMap.totalPolygons = pathsSaved.totalPolygons; //esto hace que cuando cierro unity y lo vuelvo a abrir no se pierda la info EditorUtility.SetDirty(currentMap); Close(); } } } } } } if (pathsSaved.paths.Count <= 0) { EditorGUILayout.HelpBox("There are no objects created in the map!", MessageType.Warning); } }
public static void CreateSkillAsset() { ScriptableObjectUtility.CreateAsset <NPCPrototype>(); }