This file contains hidden or 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
| let isOdd x = (x % 2 = 1) | |
| let describeNumber x = | |
| match isOdd x with | |
| | true -> printfn "x is odd" | |
| | false -> printfn "x is even" |
This file contains hidden or 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
| using UnityEditor; | |
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Text.RegularExpressions; | |
| public class PostprocessModel : AssetPostprocessor | |
| { | |
| void OnPostprocessModel(GameObject rootGameObject) |
This file contains hidden or 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
| public class StoreKitGUIManager : MonoBehaviour | |
| { | |
| // | |
| void OnGUI() | |
| { | |
| // | |
| if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Get Product Data" ) ) | |
| { | |
| // array of product ID's from iTunesConnect. MUST match exactly what you have there! | |
| string[] productIdentifiers = { |
This file contains hidden or 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
| public class PlatformCheck | |
| { | |
| public static EPlatformType GetPlatform() | |
| { | |
| // Variable declartion. | |
| if (widthToHeightAspect == aspect960_640 || widthToHeightAspect == aspect640_960) | |
| { | |
| if ((Screen.width == 960 && Screen.height == 640) || | |
| (Screen.width == 640 && Screen.height == 960)) |
This file contains hidden or 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
| public class BuildAssetBundleUtility | |
| { | |
| public static void BuildAssetBundle(string outPath, List<UnityEngine.Object> objectCollection) | |
| { | |
| BuildPipeline.BuildAssetBundle( | |
| // Main object | |
| objectCollection[0], | |
| // A collection of objects to be packed | |
| objectCollection.ToArray(), | |
| // The output location |
This file contains hidden or 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
| public class AssetBundleLoader : UnityEngine.MonoBehaviour | |
| { | |
| private WWW _www; | |
| private IEnumerator WaitLoadingBundle() | |
| { | |
| string assetBundleName = "BundleName"; | |
| // One folder level up of Application.dataPath. | |
| // This is the same level as Assets in Editor(platform). | |
| // For iPhone, this is just one group(XCode term) called AssetBundles created | |
| // same as Classes. |
This file contains hidden or 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
| public DBLoader : MonoBehaviour | |
| { | |
| public string DBLocation; | |
| public string DBFile; | |
| private SQLiteDB _mainDB = null; | |
| // Assume there is a DB which contains a table named player_info at the | |
| // specified location. | |
| private void UpdatePlayerDB(string playerName, int moneyAmount) | |
| { |
This file contains hidden or 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
| def my = 1 + 2 | |
| def your = my + 10 | |
| println { | |
| "this is cool." | |
| } |
This file contains hidden or 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
| private void AddEzDataTypeCode(CodeTypeDeclaration generatedClass) | |
| { | |
| generatedClass.Members.Add(CreatePrivateField(typeof(EZData.Property<int>), "FpsValue")); | |
| generatedClass.Members.Add(CreateIntermediateProperty(typeof(EZData.Property<int>), "FpsValue")); | |
| generatedClass.Members.Add(CreateActualProperty(typeof(int), "FpsValue")); | |
| } | |
| private CodeMemberField CreatePrivateField(Type ezDataType, string fieldName) | |
| { | |
| string ezDataTypeName = ezDataType.FullName; |
This file contains hidden or 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
| // Just a method of the class | |
| void TestAddProcess() | |
| { | |
| if (_theGameObject != null) | |
| { | |
| _theGameObject.AddComponent<PlayMakerFSM>(); | |
| PlayMakerFSM pmFsm = _theGameObject.GetComponent<PlayMakerFSM>(); | |
| if (pmFsm != null) | |
| { | |
| // Need to select fsm first |