- Home /
Question by
BeyondTemptation · Dec 30, 2016 at 09:33 AM ·
c#guihtml
Text Asset path
Hello, I am new to unity, I have a question.
I have a script with a public Entry variable as TextAsset.
][1]
And I need in code to retrive relative path of this file. The solution I have now is hacky and I don't like it. Basically I have some tag like this in the file itself
<html ng-app-entry="SimpleWebBrowser/Demo/001-general-hud" lang="en" xmlns="http://www.w3.org/1999/xhtml">
Which I then parse like this and create a path.
string pattern = @"(?<=\bng-app-entry="")[^""]*";
Regex regex = new Regex(pattern);
Match match = regex.Match(Entry.text);
string result = Application.dataPath + "/" + match.Value + "/" + Entry.name + ".html";
Can someone help me how to get something like Entry.getRelativePath(); And thats all, so I dont need to even have that attribute in html and then parse the file itself.
Thank you
Comment
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to automate unity editor screen grabs 0 Answers
Putting Dictionary/List using foreach as buttons in a scroll view? 3 Answers
Bringing a GUI window to the front 1 Answer