Skip to content

Commit

Permalink
add unity sample project.fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
moajo committed Aug 7, 2016
1 parent bdc8ab3 commit 10205a9
Show file tree
Hide file tree
Showing 30 changed files with 654 additions and 0 deletions.
Binary file removed MBTSample.unitypackage
Binary file not shown.
34 changes: 34 additions & 0 deletions MilboxTouch/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

# Created by https://www.gitignore.io/api/unity

### Unity ###
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd


# Unity3D generated meta files
*.pidb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Builds
*.apk
9 changes: 9 additions & 0 deletions MilboxTouch/Assets/Scenes.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added MilboxTouch/Assets/Scenes/sampleScene.unity
Binary file not shown.
8 changes: 8 additions & 0 deletions MilboxTouch/Assets/Scenes/sampleScene.unity.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions MilboxTouch/Assets/Scripts.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions MilboxTouch/Assets/Scripts/ControlScript.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System;

public class ControlScript : MonoBehaviour {

public Text DebugText;
public bool DebugMode = false;

// Use this for initialization
void Start () {
MBTHelper.OnTap += (angle) => {
ShowParameter(string.Format("::Tap angle:{0}::",angle));
};

MBTHelper.OnDoubleTap += (angle) => {
ShowParameter(string.Format("::DoubleTap {0}::",angle));
};

MBTHelper.OnScroll += (angle) => {
string s = String.Format("::Scroll {0} ::",angle);
ShowParameter(s);
};

MBTHelper.OnSwipe += (speed,direction) => {
var s = String.Format("::Swipespd:{0},dir:{1} ::",speed,direction);
ShowParameter(s);
};
MBTHelper.OnScrollBegan += () => {
ShowParameter("scrollBegan!!!");
};

MBTHelper.OnScrollEnd += () => {
ShowParameter("ScrollEnd!!!!");
};

MBTHelper.OnSetupProgress += () => {
ShowParameter("setupProgress:"+Time.time);
};
MBTHelper.OnSetupCompleted += () => {
ShowParameter("setupComplete!!!");
};

// DebugText.text = "";
}

private void ShowParameter (string st) {
Debug.Log (st);
if (DebugMode) {
DebugText.text = st;
}
}
}
12 changes: 12 additions & 0 deletions MilboxTouch/Assets/Scripts/ControlScript.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 10205a9

Please sign in to comment.