Example #1
0
        void InstallExamples()
        {
            string dir = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/");

            AssetDatabase.ImportPackage(dir + "/Examples.unitypackage", false);
            EditorUtility.DisplayDialog("Import Complete", "Example scenes have been added to Dreamteck/Splines", "Yey!");
            panels[5].Back();
        }
Example #2
0
        void InstallPlaymaker()
        {
            string dir = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/");

            AssetDatabase.ImportPackage(dir + "/PlaymakerActions.unitypackage", false);
            EditorUtility.DisplayDialog("Import Complete", "Playmaker actions for Dreamteck Splines have been installed.", "Yey!");
            panels[4].Back();
        }
Example #3
0
        public void init()
        {
            minSize = maxSize = new Vector2(450, 500);
#if UNITY_5_0
            title = "Dreamteck Splines " + PluginInfo.version;
#else
            titleContent = new GUIContent("Dreamteck Splines " + PluginInfo.version);
#endif
            float x = position.x;
            if (x < 50)
            {
                x = 50;
            }
            else if (x > Screen.width - 500)
            {
                x = Screen.width - 500;
            }
            float y = position.y;
            if (y < 50)
            {
                x = 50;
            }
            else if (y > Screen.height - 550)
            {
                x = Screen.height - 550;
            }
            position = new Rect(x, y, 500, 550);

            changeLogPanel               = new WindowPanel();
            supportPanel                 = new WindowPanel();
            homePanel                    = new WindowPanel();
            learnPanel                   = new WindowPanel();
            changeLogPanel.size          = supportPanel.size = homePanel.size = learnPanel.size = new Vector2(maxSize.x, maxSize.y - 82);
            changeLogPanel.slideDuration = supportPanel.slideDuration = homePanel.slideDuration = learnPanel.slideDuration = 0.25f;
            homePanel.SetState(true, false);
            header        = ImageDB.GetImage("plugin_header.png", "Splines/Editor/Icons");
            changelogIcon = ImageDB.GetImage("changelog.png", "Splines/Editor/Icons");
            learnIcon     = ImageDB.GetImage("get_started.png", "Splines/Editor/Icons");
            supportIcon   = ImageDB.GetImage("support.png", "Splines/Editor/Icons");
            rateIcon      = ImageDB.GetImage("rate.png", "Splines/Editor/Icons");
            pdfIcon       = ImageDB.GetImage("pdf.png", "Splines/Editor/Icons");
            videoIcon     = ImageDB.GetImage("video_tutorials.png", "Splines/Editor/Icons");

            string path = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/Editor");
            if (Directory.Exists(path))
            {
                if (File.Exists(path + "/changelog.txt"))
                {
                    string[] lines = File.ReadAllLines(path + "/changelog.txt");
                    changelogText = "";
                    for (int i = 0; i < lines.Length; i++)
                    {
                        changelogText += lines[i] + "\r\n";
                    }
                }
            }
            windowInitialized = true;
        }
Example #4
0
 public static void Delete(string filename)
 {
     path = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/Presets");
     if (!Directory.Exists(path))
     {
         Debug.LogError("Directory " + path + " does not exist");
         return;
     }
     File.Delete(path + "/" + filename);
 }
Example #5
0
 public static SplinePreset[] LoadAll()
 {
     path = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/Presets");
     if (!Directory.Exists(path))
     {
         Debug.LogError("Directory " + path + " does not exist");
         return(null);
     }
     string[]       files   = System.IO.Directory.GetFiles(path, "*.dsp");
     SplinePreset[] presets = new SplinePreset[files.Length];
     for (int i = 0; i < files.Length; i++)
     {
         BinaryFormatter bf   = new BinaryFormatter();
         FileStream      file = File.Open(files[i], FileMode.Open);
         presets[i]          = (SplinePreset)bf.Deserialize(file);
         presets[i].filename = new FileInfo(files[i]).Name;
         file.Close();
     }
     return(presets);
 }
Example #6
0
 public SplinePreset(SplinePoint[] p, bool closed, Spline.Type t)
 {
     points_position = new S_Vector3[p.Length];
     points_tanget   = new S_Vector3[p.Length];
     points_tangent2 = new S_Vector3[p.Length];
     points_normal   = new S_Vector3[p.Length];
     points_color    = new S_Color[p.Length];
     points_size     = new float[p.Length];
     points_type     = new SplinePoint.Type[p.Length];
     for (int i = 0; i < p.Length; i++)
     {
         points_position[i] = new S_Vector3(p[i].position);
         points_tanget[i]   = new S_Vector3(p[i].tangent);
         points_tangent2[i] = new S_Vector3(p[i].tangent2);
         points_normal[i]   = new S_Vector3(p[i].normal);
         points_color[i]    = new S_Color(p[i].color);
         points_size[i]     = p[i].size;
         points_type[i]     = p[i].type;
     }
     isClosed = closed;
     type     = t;
     path     = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/Presets");
 }
Example #7
0
        public override void Load()
        {
            base.Load();
            minSize = maxSize = new Vector2(450, 550);
            SetTitle("Dreamteck Splines " + PluginInfo.version, "Dreamteck Splines");
            panels    = new WindowPanel[6];
            panels[0] = new WindowPanel("Home", true, 0.25f);
            panels[1] = new WindowPanel("Changelog", false, panels[0], 0.25f);
            panels[2] = new WindowPanel("Learn", false, panels[0], 0.25f);
            panels[3] = new WindowPanel("Support", false, panels[0], 0.25f);
            panels[4] = new WindowPanel("Examples", false, panels[2], 0.25f);
            panels[5] = new WindowPanel("Playmaker", false, panels[0], 0.25f);



            panels[0].elements.Add(new WindowPanel.Space(400, 10));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "changelog.png", "What's new?", "See all new features, important changes and bugfixes in " + PluginInfo.version, new ActionLink(panels[1], panels[0])));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "get_started.png", "Get Started", "Learn how to use Dreamteck Splines in a matter of minutes", new ActionLink(panels[2], panels[0])));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "support.png", "Support", "Got a problem or a feature request? Our support is here to help!", new ActionLink(panels[3], panels[0])));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "playmaker.png", "Playmaker Actions", "Install Playmaker actions for Dreamteck Splines", new ActionLink(panels[5], panels[0])));
            panels[0].elements.Add(new WindowPanel.Space(400, 20));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "rate.png", "Rate", "If you like Dreamteck Splines, please consider rating it on the Asset Store", new ActionLink("http://u3d.as/sLk")));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Splines/Editor/Icons", "forever.png", "Forever", "Creating endless runners has never been easier. Forever is here to change the game!", new ActionLink("http://u3d.as/1t9T")));
            panels[0].elements.Add(new WindowPanel.Space(400, 10));
            panels[0].elements.Add(new WindowPanel.Label("This window will not appear again automatically. To open it manually go to Help/Dreamteck/About Dreamteck Splines", wrapText, new Color(1f, 1f, 1f, 0.5f), 400, 100));



            string path          = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/Editor");
            string changelogText = "Changelog file not found.";

            if (Directory.Exists(path))
            {
                if (File.Exists(path + "/changelog.txt"))
                {
                    string[] lines = File.ReadAllLines(path + "/changelog.txt");
                    changelogText = "";
                    for (int i = 0; i < lines.Length; i++)
                    {
                        changelogText += lines[i] + "\r\n";
                    }
                }
            }
            panels[1].elements.Add(new WindowPanel.Space(400, 10));
            panels[1].elements.Add(new WindowPanel.ScrollText(400, 400, changelogText));

            panels[2].elements.Add(new WindowPanel.Space(400, 10));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "youtube.png", "Video Tutorials", "Watch a series of Youtube videos to get started.", new ActionLink("https://www.youtube.com/playlist?list=PLkZqalQdFIQ4S-UGPWCZTTZXiE5MebrVo")));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "pdf.png", "User Manual", "Read a thorough documentation of the whole package along with a list of API methods.", new ActionLink("http://dreamteck.io/page/dreamteck_splines/user_manual.pdf")));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "pdf.png", "API Reference", "A description of the classes, methods and properties inside the Dreamteck Splines API", new ActionLink("http://dreamteck.io/page/dreamteck_splines/api_reference.pdf")));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "examples.png", "Examples", "Install example scenes", new ActionLink(panels[4], panels[2])));

            panels[3].elements.Add(new WindowPanel.Space(400, 10));
            panels[3].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "discord.png", "Discord Server", "Join our Discord community and chat with other developers and the team.", new ActionLink("https://discord.gg/bkYDq8v")));
            panels[3].elements.Add(new WindowPanel.Button(400, 30, "Contact Support", new ActionLink("http://dreamteck.io/team/contact.php?target=1")));

            panels[4].elements.Add(new WindowPanel.Space(400, 10));
            bool   packagExists = false;
            string dir          = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/");

            if (Directory.Exists(dir))
            {
                if (File.Exists(dir + "/Examples.unitypackage"))
                {
                    packagExists = true;
                }
            }
            if (packagExists)
            {
                panels[4].elements.Add(new WindowPanel.Button(400, 30, "Install Examples", new ActionLink(InstallExamples)));
            }
            else
            {
                panels[4].elements.Add(new WindowPanel.Label("Examples package not found", null, Color.white));
            }

            panels[5].elements.Add(new WindowPanel.Space(400, 10));
            packagExists = false;
            dir          = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Splines/");
            if (Directory.Exists(dir))
            {
                if (File.Exists(dir + "/PlaymakerActions.unitypackage"))
                {
                    packagExists = true;
                }
            }
            if (packagExists)
            {
                panels[5].elements.Add(new WindowPanel.Button(400, 30, "Install Actions", new ActionLink(InstallPlaymaker)));
            }
            else
            {
                panels[5].elements.Add(new WindowPanel.Label("Playmaker actions not found", null, Color.white));
            }
        }
Example #8
0
        public override void Load()
        {
            base.Load();
            SetTitle("Forever", "Forever");
            panels    = new WindowPanel[6];
            panels[0] = new WindowPanel("Home", true, 0.25f);
            panels[1] = new WindowPanel("Changelog", false, panels[0], 0.25f);
            panels[2] = new WindowPanel("Learn", false, panels[0], 0.25f);
            panels[3] = new WindowPanel("Support", false, panels[0], 0.25f);
            panels[4] = new WindowPanel("Examples", false, panels[2], 0.25f);
            panels[5] = new WindowPanel("Playmaker", false, panels[0], 0.25f);



            panels[0].elements.Add(new WindowPanel.Space(400, 10));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "changelog", "What's new?", "See all new features, important changes and bugfixes in " + PluginInfo.version, new ActionLink(panels[1], panels[0])));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "get_started", "Get Started", "Learn how to use Forever in a matter of minutes.", new ActionLink(panels[2], panels[0])));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "support", "Support", "Got a problem or a feature request? Our support is here to help!", new ActionLink(panels[3], panels[0])));
            panels[0].elements.Add(new WindowPanel.Space(400, 20));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "rate", "Rate", "If you like Forever, please consider rating it on the Asset Store", new ActionLink("http://u3d.as/1t9T")));
            panels[0].elements.Add(new WindowPanel.Thumbnail("Forever/Editor/Images", "dreamteck_splines", "Dreamteck Splines", "Combine Forever with the ultimate spline solution for outstanding results.", new ActionLink("http://u3d.as/sLk")));
            panels[0].elements.Add(new WindowPanel.Space(400, 10));
            panels[0].elements.Add(new WindowPanel.Label("This window will not appear again automatically. To open it manually go to Help/Dreamteck/About Forever", wrapText, new Color(1f, 1f, 1f, 0.5f), 400, 100));



            string path          = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Forever/Editor");
            string changelogText = "";

            if (Directory.Exists(path))
            {
                if (File.Exists(path + "/changelog.txt"))
                {
                    string[] lines = File.ReadAllLines(path + "/changelog.txt");
                    changelogText = "";
                    for (int i = 0; i < lines.Length; i++)
                    {
                        changelogText += lines[i] + "\r\n";
                    }
                }
            }
            panels[1].elements.Add(new WindowPanel.Space(400, 10));
            panels[1].elements.Add(new WindowPanel.ScrollText(400, 400, changelogText));

            panels[2].elements.Add(new WindowPanel.Space(400, 10));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "youtube", "Video Tutorials", "Watch a series of videos to get quikcly acquainted with Forever's workflow.", new ActionLink("https://www.youtube.com/c/Dreamteck")));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "pdf", "User Manual", "Read a thorough documentation of the whole package along with a list of API methods.", new ActionLink("http://dreamteck.io/page/forever/user_manual.pdf")));
            panels[2].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "examples", "Examples", "Install examples in this project.", new ActionLink(panels[4], panels[2])));

            panels[3].elements.Add(new WindowPanel.Space(400, 10));
            panels[3].elements.Add(new WindowPanel.Thumbnail("Utilities/Editor/Images", "discord", "Discord Server", "Join our Discord community and chat with other developers and the team.", new ActionLink("https://discord.gg/bkYDq8v")));
            panels[3].elements.Add(new WindowPanel.Button(400, 30, "Contact Support", new ActionLink("http://dreamteck.io/team/contact.php?target=1")));


            panels[4].elements.Add(new WindowPanel.Space(400, 10));
            bool   packagExists = false;
            string dir          = ResourceUtility.FindFolder(Application.dataPath, "Dreamteck/Forever/");

            if (Directory.Exists(dir))
            {
                if (File.Exists(dir + "/Examples.unitypackage"))
                {
                    packagExists = true;
                }
            }
            if (packagExists)
            {
                panels[4].elements.Add(new WindowPanel.Button(400, 30, "Install Examples", new ActionLink(InstallExamples)));
            }
            else
            {
                panels[4].elements.Add(new WindowPanel.Label("Examples package not found", null, Color.white));
            }
            panels[5].elements.Add(new WindowPanel.Space(400, 10));
        }