본문 바로가기

NOTE/SaveSource19

[Source Save] MobileSensorManager.cs using System.Collections.Generic;using UnityEngine; public enum Horizontal { Horizon, Right, Left };public enum Vertical { Stand, Front, Back }; class MobileSensorManager : SingleTon{ private float _lat; private float _lon; private float _sensorX; // 좌우 기울기 private float _sensorZ; // 앞뒤 기울기 public Horizontal horizon; public Vertical vertical; private MobileSensorManager() { } public void SensorD.. 2016. 11. 1.
[Source Save] TouchCameraMove.cs using System;using System.Collections.Generic;using UnityEngine; class TouchCameraMove : SingleTon{ public GameObject Target; public float dragX; public const int dir = -1; public float speed = 1f; // 속도 public float distance = 2f; // 거리 public float height = 3f; // 높이 public float dampTrace = 20f; // 감도 public float maxZoom = 100f; public float minZoom = 30f; public bool setZoom; private TouchC.. 2016. 10. 31.
[Source Save] InputTouchManager.cs using UnityEngine;using System.Collections.Generic; /* RotateTap, Double Tap, Press, Drag*/ class InputTouchManager : SingleTon{ #region One finger Value private Touch _initTouch = new Touch(); private Vector2 _dragXY = Vector2.zero; // X,Y 축으로 드래그한 정도 private float _pressTime; // Press 판정을 위한 시간 private bool _isDrag; private bool _isPress; private bool _isDoubleTap; private GameObject _rayObjec.. 2016. 10. 27.
[SaveSource] Drag Script public class TouchManager : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler { public void OnBeginDrag(PointerEventData _eventData) { transform.position = _eventData.position; } public void OnDrag(PointerEventData _eventData) { transform.position = _eventData.position; } public void OnEndDrag(PointerEventData _eventData) { transform.position = _eventData.position; } } - 이벤트 핸들러를 붙.. 2016. 10. 14.