Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        MouseMovement = new Vector2(0.0f, 0.0f);

        playerCamera             = Camera.main;
        playerCamera.fieldOfView = fov;
        playerTransform          = GetComponent <Transform>();
        GunHandle temp = GetComponent <GunHandle>();

        gunTransform = temp.transform;
        playerCamera.transform.position = temp.gunReference.transform.position + new Vector3(-0.10f, 0.25f, -0.4f); // + new Vector3(0.0f, 1.5f, 0.5f);
        playerCamera.transform.rotation = temp.gunReference.transform.rotation;                                     // gunTransform.rotation;

        temp.gunReference.transform.SetParent(playerCamera.transform);
        temp.gunReference.transform.position += new Vector3(0, 0.05f, 0);
        playerCamera.transform.SetParent(transform);
        playerCamera.transform.localPosition = new Vector3(0.0f, 1.6f, 0.0f);


        Transform a4  = transform.GetChild(0);
        Transform hip = a4.GetChild(2);
        Transform s0  = hip.GetChild(2);
        Transform s1  = s0.GetChild(0);

        lookRotationBone   = s1.GetChild(0);
        actualGunTransform = transform.GetChild(1);
    }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     healthHandle = GetComponent <Health>();
     gunHandle    = GetComponent <GunHandle>();
 }