Skip to content

Instantly share code, notes, and snippets.

@KRNKRS
KRNKRS / gist:5230256
Created March 24, 2013 02:49
うごかん
void Update()
{
Move += MoveVel;
if (Move >= 0.5 ||
Move <= -4)
{
MoveVel = 0;
}
@KRNKRS
KRNKRS / gist:5230315
Created March 24, 2013 03:08
座標移動バグコード
void Update()
{
Move += Vel;
if (Move >= 0.5 ||
Move <= -4)
{
Vel = 0;
}
@KRNKRS
KRNKRS / gist:5230318
Created March 24, 2013 03:10
座標移動訂正コード
void Update()
{
if (transform.position.x >= 0.5 ||
transform.position.x <= -4)
{
Vel = 0;
}
#region キー入力
//右が押されたら
if (AssetDatabase.FindAssets("t:script SteamVR").Length > 0)
{
var nowSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
var addSymbol = "EXSISTENCE_STEAM_VR";
if(nowSymbols.IndexOf(addSymbol) < 0)
{
addSymbol = ";" + addSymbol + ";";
var newSymbols = nowSymbols + addSymbol;
PlayerSettings.SetScriptingDefineSymbolsForGroup(
EditorUserBuildSettings.selectedBuildTargetGroup,
public class StandaloneInputModule : PointerInputModule
{
//更新処理
public override void Process()
{
//1. 更新処理や入力処理(割愛)
//2. 入力によるイベント呼び出し
ExecuteEvents.Execute(イベントを送る対象, 対象に送るイベントデータ, 送信するイベントのタイプ);
}
}
protected virtual PointerEventData GetMousePointerEventData()
{
//ポインタのデータ作成
PointerEventData pointerData;
var created = GetPointerData (kMouseId, out pointerData, true);
//データ初期化
pointerData.Reset ();
//マウスの諸々の情報をポインタの情報として渡す
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
using UnityEngine.VR;
using VRDebug;
namespace VRDebug
{
using UnityEngine;
using UnityEngine.UI;
#if UNITY_EDITOR
using UnityEditor;
#endif
using System.Collections;
using System.Collections.Generic;
using System;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerRotate : MonoBehaviour {
private GameObject mainAimObj;
public float rotateSpeed = 1;
public Constrain constrainX;
public Constrain constrainY;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AimFollow : MonoBehaviour {
private GameObject followTarget;
private Vector3 offset;
void Awake () {