Beispiel #1
0
    private MouseLookScript CameraPlayerLookAt; //Skrypt LookAt off if Puzzle start
    void Start()
    {
        Date1               = GameObject.Find("Timeline/Date1").GetComponent <TextMeshProUGUI>();
        Date2               = GameObject.Find("Timeline/Date2").GetComponent <TextMeshProUGUI>();
        Date3               = GameObject.Find("Timeline/Date3").GetComponent <TextMeshProUGUI>();
        Date4               = GameObject.Find("Timeline/Date4").GetComponent <TextMeshProUGUI>();
        PickUpText          = GameObject.Find("Canvas/PickUpText").GetComponent <Text>();
        CountCollection     = GameObject.Find("CollectionInterface/CollectionCountText").GetComponent <Text>();
        ViewFinder          = GameObject.Find("Canvas/ViewFinder").GetComponent <Image>();
        InterfaceField      = GameObject.Find("Interface/InterfaceField");
        CollectionInterface = GameObject.Find("Canvas/CollectionInterface");
        CameraPlayerLookAt  = GameObject.Find("FPPlayer/CameraPlayer").GetComponent <MouseLookScript>();

        //Puzzle
        Puzzle = GameObject.Find("Puzzle");
        PuzzleHidden();
        Puzzle.GetComponent <Canvas>().enabled = true;

        CollectionInterfaceHidden();
        CollectionInterface.GetComponent <Canvas>().enabled = true;
        InterfaceFieldHidden();
        startPosition        = transform.position;
        currentdata          = startdata;
        PickUpText.text      = "Podnieś";
        CountCollection.text = "0 / 21";



        Date2.text = startdata.ToString();
    }
Beispiel #2
0
    void Start()
    {
        controller      = GetComponent <CharacterController> ();
        cameraTransform = Camera.main.transform;


        iCam = Camera.main;

        iCamScript = iCam.GetComponent <MouseLookScript> ();
        //anim = GetComponent<Animator>();
    }
Beispiel #3
0
    public int patchActive;      // bitflag carrier for active patches

    // Patches stack so multiple can be used at once
    // For instance, berserk + staminup + medi = 1 + 64 + 8 = 73
    // This is turning on bits in the int patchActive so above would be: 01001001,
    // meaning 3 patches are enabled out of the 7 types (short integer has 8 bits
    // but the 7th bit can be used for sign +/-)

    void Awake()
    {
        playerHealthScript    = gameObject.GetComponent <PlayerHealth>();
        playerMouseLookScript = playerCamera.GetComponent <MouseLookScript>();
        playerMovementScript  = gameObject.GetComponent <PlayerMovement>();
        SFX = GetComponent <AudioSource>();
        mediFinishedTime   = -1f;
        reflexFinishedTime = -1f;
        sightFinishedTime  = -1f;
        berserk            = playerCamera.GetComponent <UnityStandardAssets.ImageEffects.BerserkEffect>();
    }
Beispiel #4
0
    void Use(GameObject owner)
    {
        mouseCursor.GetComponent <MouseCursor>().cursorImage = cursorTexture;
        Cursor.lockState = CursorLockMode.None;
        MouseLookScript mlook = owner.GetComponent <PlayerReferenceManager>().playerCapsuleMainCamera.GetComponent <MouseLookScript>();

        mlook.ForceInventoryMode();          // inventory mode is turned on when picking something up
        mlook.holdingObject             = true;
        mlook.heldObjectIndex           = useableItemIndex;
        mlook.heldObjectCustomIndex     = customIndex;
        mlook.heldObjectAmmo            = ammo;
        mlook.heldObjectAmmoIsSecondary = ammoIsSecondary;
        this.gameObject.SetActive(false);
    }
	void  Awake (){
		isCapsLockOn = false;
		currentCrouchRatio = 1;
		bodyState = 0;
		originalLocalScaleY = transform.localScale.y;
		crouchLocalScaleY = transform.localScale.y * crouchRatio;
		rbody = GetComponent<Rigidbody>();
		oldVelocity = rbody.velocity;
		//rbody.useGravity = false;
		mlookScript = cameraObject.GetComponent<MouseLookScript>();
		capsuleHeight = GetComponent<CapsuleCollider>().height;
		//originalCapsuleHeight = capsuleHeight;
		capsuleRadius = GetComponent<CapsuleCollider>().radius;
		layerMask = 1 << layerGeometry;
	}
Beispiel #6
0
 void  Awake()
 {
     isCapsLockOn        = false;
     currentCrouchRatio  = 1;
     bodyState           = 0;
     originalLocalScaleY = transform.localScale.y;
     crouchLocalScaleY   = transform.localScale.y * crouchRatio;
     rbody       = GetComponent <Rigidbody>();
     oldVelocity = rbody.velocity;
     //rbody.useGravity = false;
     mlookScript   = cameraObject.GetComponent <MouseLookScript>();
     capsuleHeight = GetComponent <CapsuleCollider>().height;
     //originalCapsuleHeight = capsuleHeight;
     capsuleRadius = GetComponent <CapsuleCollider>().radius;
     layerMask     = 1 << layerGeometry;
 }
Beispiel #7
0
 void Use(GameObject owner)
 {
     tex = Const.a.useableItemsFrobIcons[useableItemIndex];
     if (tex != null)
     {
         owner.GetComponent <PlayerReferenceManager>().playerCursor.GetComponent <MouseCursor>().cursorImage = Const.a.useableItemsFrobIcons[useableItemIndex];                     // set cursor to this object
     }
     mlook = owner.GetComponent <PlayerReferenceManager>().playerCapsuleMainCamera.GetComponent <MouseLookScript>();
     mlook.ForceInventoryMode();          // inventory mode is turned on when picking something up
     mlook.holdingObject             = true;
     mlook.heldObjectIndex           = useableItemIndex;
     mlook.heldObjectCustomIndex     = customIndex;
     mlook.heldObjectAmmo            = ammo;
     mlook.heldObjectAmmoIsSecondary = ammoIsSecondary;
     // should I assign mlook to null at this point so that I don't accidentally have a bug in multiplayer where the wrong player reference gets an object picked up
     // nah, I trust GetComponent to work for the owner who sent the Use command
     this.gameObject.SetActive(false);         //we've been picked up, quick hide like you are actually in the player's hand
 }
    /*
     * Collection the variables upon awake that we need.
     */
    void Awake()
    {
        mls             = GameObject.FindGameObjectWithTag("Player").GetComponent <MouseLookScript>();
        player          = mls.transform;
        mainCamera      = mls.myCamera;
        secondCamera    = GameObject.FindGameObjectWithTag("SecondCamera").GetComponent <Camera>();
        cameraComponent = mainCamera.GetComponent <Camera>();
        pmS             = player.GetComponent <PlayerMovementScript>();

        bulletSpawnPlace = GameObject.FindGameObjectWithTag("BulletSpawn");
        hitMarker        = transform.Find("hitMarkerSound").GetComponent <AudioSource> ();

        startLook = mouseSensitvity_notAiming;
        startAim  = mouseSensitvity_aiming;
        startRun  = mouseSensitvity_running;

        rotationLastY = mls.currentYRotation;
        rotationLastX = mls.currentCameraXRotation;
    }
Beispiel #9
0
 void Awake()
 {
     //gameMaster = GameObject.Find ("GameMasterObject");
     //gmobj = gameMaster.GetComponent<GameMasterObject> ();
     //lookAround1 = lv1TurretNorth.GetComponentInChildren<MouseLookScript> ();
     lookAround2 = lv1TurretWest.GetComponentInChildren <MouseLookScript> ();
     lookAround3 = lv1TurretEast.GetComponentInChildren <MouseLookScript> ();
     lookAround4 = lv2TurretWest.GetComponentInChildren <MouseLookScript> ();
     lookAround5 = lv2TurretEast.GetComponentInChildren <MouseLookScript> ();
     //mount1 = lv1TurretNorth.GetComponentInChildren<MountedTurretGuns> ();
     mount2 = lv1TurretWest.GetComponentInChildren <MountedTurretGuns> ();
     mount3 = lv1TurretEast.GetComponentInChildren <MountedTurretGuns> ();
     mount4 = lv2TurretWest.GetComponentInChildren <MountedTurretGuns> ();
     mount5 = lv2TurretEast.GetComponentInChildren <MountedTurretGuns> ();
     //cam1 = lv1TurretNorth.GetComponentInChildren<Camera> ();
     cam2         = lv1TurretWest.GetComponentInChildren <Camera> ();
     cam3         = lv1TurretEast.GetComponentInChildren <Camera> ();
     cam4         = lv2TurretWest.GetComponentInChildren <Camera> ();
     cam5         = lv2TurretEast.GetComponentInChildren <Camera> ();
     dannyWeapons = danny.GetComponent <DannyWeaponScript> ();
 }
	void  Start (){
		mlookScript = cameraObject.GetComponent<MouseLookScript>(); // Get the mouselookscript to reference rotation
	}
Beispiel #11
0
 void Start()
 {
     playerMovement = Player.GetComponent <PlayerMovement>();
     mainCam        = Player.transform.GetChild(0).GetChild(0).GetComponent <Camera>();
     mouseLook      = mainCam.GetComponent <MouseLookScript>();
 }
Beispiel #12
0
 void  Start()
 {
     mlookScript = cameraObject.GetComponent <MouseLookScript>();        // Get the mouselookscript to reference rotation
 }