Ejemplo n.º 1
0
    public static void TriggerEvent(string eventName, GameObject g)
    {
        ObjEvent thisEvent = null;

        if (instance.ObjEventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(g);
        }
    }
Ejemplo n.º 2
0
    public static void TriggerEvent(ParameterizedGameEvent eventName, object objParameter)
    {
        ObjEvent thisEvent = null;

        if (instance.objEventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(objParameter);
        }
    }
Ejemplo n.º 3
0
        public void Grab(VRHand hand, Vector3 position, Quaternion rotation)
        {
            if (Holder != null || !CanGrab)
            {
                return;
            }

            Holder  = hand;
            holdPos = RelativePos(GrabRoot ? GrabRoot.position : position);
            holdRot = RelativeRot(GrabRoot ? GrabRoot.rotation : rotation);
            OnGrab.Invoke(hand.gameObject);
        }
Ejemplo n.º 4
0
        public virtual void Grab()
        {
            if (currentObject != null)
            {
                return;
            }

            currentObject = FindObject(rb.position);

            if (currentObject)
            {
                OnGrab.Invoke(currentObject.gameObject);
                currentObject.Grab(this, rb.position, rb.rotation);
            }
        }
Ejemplo n.º 5
0
 public void Show(params object[] args)
 {
     gameObject.SetActive(true);
     OnShow?.Invoke(args);
 }