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
// Use it with GyroManager | |
// https://gist.github.com/blue0513/36443a54a852ba997ebbe274065ab647 | |
using UnityEngine; | |
using System.Collections; | |
public class WalkDetector : MonoBehaviour { | |
private Vector3 acc; | |
private float[] walk; |
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
using UnityEngine; | |
using System.Collections; | |
public class GyroManager : MonoBehaviour { | |
static bool gyroBool = false; | |
private Gyroscope gyro; | |
private Quaternion quatMult; | |
private GameObject camParent; | |
// WalkDetectorで参照する |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// Load Images from start to end | |
public class ImagesLoader : MonoBehaviour { | |
// index for images | |
private int imageIndex=0; | |
// number of images to load | |
private int numberOfImages; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using UnityEngine; | |
public class LogWriter : MonoBehaviour { | |
private float timer = 0f; | |
private float logSpan = 1f; | |
// log path | |
private string storedFilePath = ""; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// Especially for iPad | |
public class StandbyDirector : MonoBehaviour { | |
private Vector3 acc = Vector3.zero; | |
private Vector3 oldacc = Vector3.zero; | |
private float timer = 0f; | |
private bool isFinished = false; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
// Set Object Property (Pos, Rot, Size) with Lerp | |
public class ObjectPropertyDirector : MonoBehaviour { | |
private Vector3 modifyAngles (Vector3 rot) { | |
rot.x = modifyAngle (rot.x); | |
rot.y = modifyAngle (rot.y); |
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
using UnityEngine; | |
using System.Collections; | |
using System.IO; | |
using System.Collections.Generic; | |
using System; | |
public class ReadSettingsFromServer : MonoBehaviour { | |
// 設定格納用Dictionary | |
public static Dictionary<string, string> Setting; | |
private string[] paralist; |
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
using UnityEngine; | |
using System.Collections; | |
using System.IO; | |
// use it with uploader php | |
// https://gist.github.com/blue0513/7f772c0ad1e78903a3839e78bffbba0a | |
public class PostDataToServer : MonoBehaviour { | |
private string folderPath = "/Data"; | |
private string phpUrl = "http://foo/bar/upload.php" |
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
<?php | |
if(isset($_FILES['theFile'])) { | |
$uploaddir = "YOUR DATA PATH"; | |
$uploadfile = $uploaddir . basename($_FILES['theFile']['name']); | |
if(move_uploaded_file($_FILES['theFile']['tmp_name'], $uploadfile)){; | |
echo "success"; | |
} | |
} else { |
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
#!/bin/bash | |
# NOTE: Get it from gitlab | |
PRIVATE_TOKEN='[YOUR PRIVATE TOKEN]' | |
# NOTE: Get it from your project's setting page | |
PROJECT_ID='[YOUR PROJECT ID]' | |
# NOTE: URL should start from `[https|http]://` | |
PROJECT_URL=$(git config remote.origin.url | cut -f2 | rev | cut -c 5- | rev) |
OlderNewer