예제 #1
0
    void OnMouseOver()
    {
        float distance = Vector3.Distance(transform.position, player.transform.position);

        if (distance < selectionDistance && playerIsActive)
        {
            if (!isAlarmTriggered)
            {
                select.Display("Trigger Alarm", Color.white);
            }
            else
            {
                select.Close();
            }
        }
    }
예제 #2
0
    void OnMouseDown()
    {
        float distance;

        distance = Vector3.Distance(transform.position, player.position);
        if (playerIsActive && distance < selectionDistance && enabled)
        {
            PickUpItem();
            select.Close();
        }
    }
예제 #3
0
 void OnMouseExit()
 {
     select.Close();
 }