-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First check in of updated and new tutorials
- Loading branch information
Showing
351 changed files
with
16,098 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
66 changes: 66 additions & 0 deletions
66
MiniTutorial_ChangingScenes/Assets/Editor/PostBuildProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// IDEUM | ||
// Copyright 2011-2013 Ideum | ||
// All Rights Reserved. | ||
// | ||
// GestureWorks Unity | ||
// | ||
// File: PostBuildProcessor.cs | ||
// Authors: Ideum | ||
// | ||
// NOTICE: Ideum permits you to use, modify, and distribute this file only | ||
// in accordance with the terms of the license agreement accompanying it. | ||
// | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEditor; | ||
using UnityEditor.Callbacks; | ||
|
||
public class PostBuildProcessor { | ||
|
||
[PostProcessBuild] | ||
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) { | ||
|
||
if(target.ToString()=="StandaloneWindows"){ | ||
|
||
string gmlFileName = GestureWorksUnity.Instance.GmlFileName; | ||
string coreDllFileName = GestureWorksUnity.Instance.DllFileName; | ||
|
||
string pathToNewDataFolder = ""; | ||
string pathToAssetsFolder = UnityEngine.Application.dataPath; | ||
pathToAssetsFolder = pathToAssetsFolder.Replace("/", "\\"); | ||
|
||
//destination /Bin folder | ||
string[] pathPieces = pathToBuiltProject.Split("/".ToCharArray() ); | ||
|
||
if(pathPieces.Length == 0) { | ||
return; | ||
} | ||
|
||
string exeName = pathPieces[pathPieces.Length-1]; | ||
|
||
exeName = exeName.Replace(".exe", ""); // extract the name of the exe to use with the name of the data folder | ||
for(int i=1; i<pathPieces.Length; i++) { | ||
pathToNewDataFolder += pathPieces[i-1] + "\\"; // this will grab everything except for the last | ||
} | ||
pathToNewDataFolder += exeName + "_Data\\"; | ||
|
||
FileUtil.CopyFileOrDirectory(pathToAssetsFolder + GestureWorksUnity.Instance.GmlFilePathEditor + gmlFileName, | ||
pathToNewDataFolder + gmlFileName); | ||
|
||
FileUtil.CopyFileOrDirectory(pathToAssetsFolder + GestureWorksUnity.Instance.DllFilePathEditor + coreDllFileName, | ||
pathToNewDataFolder + coreDllFileName); | ||
|
||
Dictionary<string, string> configEntries = new Dictionary<string, string>(); | ||
|
||
configEntries.Add("ProductName", PlayerSettings.productName); | ||
|
||
GestureWorksConfiguration.WriteConfigurationFile(pathToNewDataFolder, configEntries); | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
MiniTutorial_ChangingScenes/Assets/Editor/PostBuildProcessor.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.