42 lines
875 B
C#
42 lines
875 B
C#
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;
|
|
}
|
|
}
|