Skip to content

Instantly share code, notes, and snippets.

@peroon
Last active December 10, 2015 01:54
Show Gist options
  • Select an option

  • Save peroon/77bf8a1d63ba6e017ea0 to your computer and use it in GitHub Desktop.

Select an option

Save peroon/77bf8a1d63ba6e017ea0 to your computer and use it in GitHub Desktop.
// URL
https://www.assetstore.unity3d.com/jp/#!/content/51519
// 係数はCoef, 定数はk_xxx
private const float k_ExpDampCoef = -20f; // Coefficient used to damp the rotation.
// メンバ変数
[SerializeField] private float m_MinYRotation = -20f; // The maximum amount the transform can rotate around the y axis in the opposite direction.
// 名前空間
namespace VRStandardAssets.Examples{}
// static変数でゲームのスコア管理
private static int s_HighScore; // Used to store the highscore for the current game type.
// PlayerPrefsに入れたらSaveする
PlayerPrefs.SetInt(s_CurrentGame, s_Score);
PlayerPrefs.Save();
// アクション
public event Action<Asteroid> OnAsteroidRemovalDistance; // This event is triggered when it is far enough behind the camera to be removed.
// アクションにプラスしていく!?
m_InteractiveItem.OnOver += HandleOver;
// アクションを引く
m_InteractiveItem.OnOver -= HandleOver;
// using
using Random = UnityEngine.Random;
// タイプやスタイル
public enum OrbitStyle
{
Smooth, Step, StepWithFade,
}
// さっさとReturnさせる
if(!m_PowerOn)
return;
// レンジ
[Range(1f, 4f)][SerializeField] float m_GravityMultiplier = 2f;
// エディタ時は情報を多く
#if UNITY_EDITOR
Debug.DrawLine(transform.position + (Vector3.up * 0.1f), transform.position + (Vector3.up * 0.1f) + (Vector3.down * m_GroundCheckDistance));
#endif
// リードオンリー
private readonly int m_HashPowerUpPara = Animator.StringToHash("PowerUp"); // Used to reference the different animator parameters.
// フラグ
public bool IsPlaying { get; private set; } // Whether or not the game is currently playing.
// Vector3関数
Vector3 flatCamForward = Vector3.ProjectOnPlane(m_Camera.forward, Vector3.up).normalized;
float angleDelta = Vector3.Angle (desiredForward, flatCamForward);
// コルーチン変数
private Coroutine m_WarningCoroutine; // Reference to the coroutine that displays the warning message so it can be stopped prematurely.
...
m_WarningCoroutine = StartCoroutine (DisplayWarning (m_DoubleTapWarningMessage));
// 空文字列
m_WarningText.text = string.Empty;
// マルチライン
[Multiline] public string m_Text;
// キャンバスを強制更新
Canvas.ForceUpdateCanvases();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment