Пример #1
0
    // Start is called before the first frame update
    public void OnEnable()
    {
        useGun = false;

        info     = GameObject.Find("[INFO]").GetComponent <Info_Manager>();
        saveload = GameObject.Find("[SAVELOAD]").GetComponent <SaveLoad>();

        // Controller Events
        _events = GetComponent <VRTK_ControllerEvents>();
        _events.TriggerPressed  += onTriggerPressed;
        _events.TriggerReleased += onTriggerReleased;

        _events.GripPressed  += onGripPressed;
        _events.GripReleased += onGripReleased;

        // Grab Events
        _grabEvent = GetComponent <VRTK_InteractGrab>();
        _grabEvent.ControllerGrabInteractableObject        += onGrabObject;
        _grabEvent.ControllerStartUngrabInteractableObject += onGrabObjectRelease;

        Debug.Log("events start");
    }
Пример #2
0
 // Start is called before the first frame update
 void Start()
 {
     info = GameObject.Find("[INFO]").GetComponent <Info_Manager>();
     this.gameObject.GetComponent <Rigidbody>().AddForce(this.transform.forward * bullet_force);
     Destroy(this.gameObject, 5);
 }