@@ -1640,12 +1640,9 @@ private void BtnClearBuildReport_Click(object sender, RoutedEventArgs e)
1640
1640
private void MenuStartWebGLServer_Click ( object sender , RoutedEventArgs e )
1641
1641
{
1642
1642
// runs unity SimpleWebServer.exe and launches default Browser into project build/ folder'
1643
- // TODO add setting for your default webgl folder inside Builds/ (examples, Builds/ or Builds/webgl/)
1644
- if ( tabControl . SelectedIndex != 0 ) return ;
1645
1643
1646
1644
var proj = GetSelectedProject ( ) ;
1647
1645
var projPath = proj ? . Path . Replace ( '/' , '\\ ' ) ;
1648
-
1649
1646
if ( string . IsNullOrEmpty ( projPath ) == true ) return ;
1650
1647
1651
1648
var buildPath = Path . Combine ( projPath , "Builds" , txtWebglRelativePath . Text ) ;
@@ -1689,6 +1686,34 @@ private void TxtWebglRelativePath_TextChanged(object sender, TextChangedEventArg
1689
1686
Properties . Settings . Default . webglBuildPath = txtWebglRelativePath . Text ;
1690
1687
Properties . Settings . Default . Save ( ) ;
1691
1688
}
1689
+
1690
+ private void MenuItemBrowsePersistentDataPath_Click ( object sender , RoutedEventArgs e )
1691
+ {
1692
+ var proj = GetSelectedProject ( ) ;
1693
+ var projPath = proj ? . Path . Replace ( '/' , '\\ ' ) ;
1694
+ if ( string . IsNullOrEmpty ( projPath ) == true ) return ;
1695
+
1696
+ var psPath = Path . Combine ( projPath , "ProjectSettings" , "ProjectSettings.asset" ) ;
1697
+ if ( File . Exists ( psPath ) == false ) return ;
1698
+ // read project settings
1699
+ var rows = File . ReadAllLines ( psPath ) ;
1700
+
1701
+ // search company and product name rows
1702
+ for ( int i = 0 , len = rows . Length ; i < len ; i ++ )
1703
+ {
1704
+ // skip rows until companyname
1705
+ if ( rows [ i ] . IndexOf ( "companyName:" ) == - 1 ) continue ;
1706
+
1707
+ var companyName = rows [ i ] . Split ( new [ ] { "companyName: " } , StringSplitOptions . None ) [ 1 ] ;
1708
+ var productName = rows [ i + 1 ] . Split ( new [ ] { "productName: " } , StringSplitOptions . None ) [ 1 ] ;
1709
+
1710
+ // open folder from %userprofile%\AppData\LocalLow\<companyname>\<productname>
1711
+ var dataFolder = Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . LocalApplicationData ) + "/../LocalLow" ) ;
1712
+ var psFullPath = Path . Combine ( dataFolder , companyName , productName ) ;
1713
+ Tools . LaunchExplorer ( psFullPath ) ;
1714
+ break ;
1715
+ }
1716
+ }
1692
1717
} // class
1693
1718
} //namespace
1694
1719
0 commit comments