1. svn -> git
This commit is contained in:
41
Assets/DO_Studio/InputManager.cs
Normal file
41
Assets/DO_Studio/InputManager.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
public class InputManager : MonoBehaviour {
|
||||
|
||||
enum _InputStatus
|
||||
{
|
||||
NONE = 0x00,
|
||||
MOUSE_OVER = 0x01,
|
||||
MOUSE_PUSH = 0x02,
|
||||
MOUSE_UP = 0x04,
|
||||
MOUSE_MOVE = 0x08,
|
||||
};
|
||||
|
||||
private _InputStatus m_currentState = _InputStatus.NONE;
|
||||
private GameObject m_attachObject = null;
|
||||
|
||||
// Use this for initialization
|
||||
void Start () {
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update () {
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
m_currentState |= _InputStatus.MOUSE_PUSH;
|
||||
|
||||
if (Input.GetMouseButtonUp(0))
|
||||
m_currentState |= _InputStatus.MOUSE_UP;
|
||||
}
|
||||
|
||||
public void AttachObject (GameObject gameobject)
|
||||
{
|
||||
m_attachObject = gameobject;
|
||||
}
|
||||
|
||||
public void DettachObject (GameObject gameobject)
|
||||
{
|
||||
m_attachObject = null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user