示例#1
0
 public static void CreateConversationData()
 {
     ScriptableObjectUtility.CreateAsset <ConversationData>();
 }
示例#2
0
 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);
    }
示例#6
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <LanguageData> ();
 }
示例#7
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <Recipe>();
 }
示例#8
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <YourClass>();
 }
示例#9
0
 static public void CreateItem()
 {
     ScriptableObjectUtility.CreateAsset <BaseItem>();
 }
示例#10
0
 public static void CreateTile()
 {
     ScriptableObjectUtility.CreateAsset <_5x5Tile>();
 }
示例#11
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <ForcePrec_SO>();
 }
示例#12
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <HeroDataList> ();
 }
示例#13
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <Bullet>();
 }
示例#14
0
 public static void CreateAbilityCatalogRecipe()
 {
     ScriptableObjectUtility.CreateAsset <AbilityCatalogRecipe>();
 }
示例#15
0
        public static void CreateAsset()
        {
            var newCurrency = ScriptableObjectUtility.CreateAsset <WalletCurrency>("Assets/HigherOrLower/Wallet/Currencies/");

            newCurrency.Setup();
        }
示例#16
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <RangeWeaponData>();
 }
示例#17
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <ItemData> ();
 }
示例#18
0
 public static void CreateScriptableObject()
 {
     ScriptableObjectUtility.CreateAsset <Throwable>();
 }
示例#19
0
 private void OnDestroy()
 {
     ScriptableObjectUtility.RemoveScriptableObjectFromPreloadedAssets(AllSavesData.Instance);
 }
示例#20
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <DynamicEvent> ();
 }
示例#21
0
 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);
    }
示例#24
0
 public static void Create()
 {
     ScriptableObjectUtility.CreateAsset <ShowInteractableReaction>();
 }
示例#25
0
 public static void CreateDialogues()
 {
     ScriptableObjectUtility.CreateAsset <UnitsTable>();
 }
示例#26
0
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <EquipmentBlueprint>();
 }
 public static void CreateAsset()
 {
     ScriptableObjectUtility.CreateAsset <EnvObjPrefabData> ();
 }
示例#28
0
    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);
        }
    }
示例#30
0
 public static void CreateSkillAsset()
 {
     ScriptableObjectUtility.CreateAsset <NPCPrototype>();
 }