Example #1
0
    // Use this for initialization
    void Start()
    {
        gun = GetComponentInChildren <GrenadeGunManager>();
        right.TriggerClicked += new ControllerInteractionEventHandler(OnTriggerClicked);

        left.GripPressed += new ControllerInteractionEventHandler(OnGripPressed);
        instance          = this;
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     // Lock cursor to center of the screen to make our lives easier
     Cursor.lockState = CursorLockMode.Locked;
     // locate our head
     head = transform.Find("Head");
     // if we are running on our machine, find the main camera and attach it
     if (photonView.isMine && snatchMainCam)
     {
         Transform mainCam = Camera.main.transform;
         mainCam.position = head.position;
         mainCam.rotation = head.rotation;
         mainCam.SetParent(head);
     }
     // get our rigidbody to work with physicz
     rb = GetComponent <Rigidbody>();
     // get our gun to fire
     gun = GetComponentInChildren <GrenadeGunManager>();
 }