public static void TriggerEvent(string eventName, GameObject g) { ObjEvent thisEvent = null; if (instance.ObjEventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(g); } }
public static void TriggerEvent(ParameterizedGameEvent eventName, object objParameter) { ObjEvent thisEvent = null; if (instance.objEventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(objParameter); } }
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); }
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); } }
public void Show(params object[] args) { gameObject.SetActive(true); OnShow?.Invoke(args); }