Beispiel #1
0
    public void OnPointerClick(PointerEventData eventData)
    {
        MDebug.Log(gameObject.name + " focus " + inFocus);
        if (Input.GetKeyUp(KeyCode.Alpha0))
        {
            Cheat = !Cheat;
        }
        if (!HumanInput())
        {
            return;
        }

        if (inFocus && !RC_Camera.HasBlockingAction())
        {
            Select();
        }
        else
        {
            MDebug.Log("asdsd");
        }
    }
Beispiel #2
0
    IEnumerator SelectionThread()
    {
        GameObject ActiveObject = LastTouchObject;


        while (Input.GetButton("Fire1"))
        {
            if (RC_Camera.HasBlockingAction())
            {
                yield break;
            }

            if (Cast())
            {
                LastTouchObject.SendMessage("TouchHold", LastHitPosition, SendMessageOptions.DontRequireReceiver);
            }
            ActiveObject = LastTouchObject;
            yield return(null);
        }

        if (RC_Camera.HasBlockingAction())
        {
            yield break;
        }

        MDebug.Log("Selection Thread End");
        if (ActiveObject != null)
        {
            MDebug.Log("Send Touchup to " + ActiveObject.name);
            ActiveObject.SendMessage("TouchUp", SendMessageOptions.DontRequireReceiver);
        }
        else
        {
            UnselectCurrent();
        }
    }