Inheritance: MonoBehaviour
コード例 #1
0
    void Start()
    {
        //set up object and component references
        playerObj            = Camera.main.transform.GetComponent <CameraControl>().playerObj;
        myTransform          = transform;//store this object's transform for optimization
        playerObjTransform   = playerObj.transform;
        mainCameraTransform  = Camera.main.transform;
        FPSPlayerComponent   = playerObj.GetComponent <FPSPlayer>();
        weaponObj            = FPSPlayerComponent.weaponObj;
        MouseLookComponent   = transform.parent.transform.GetComponent <SmoothMouseLook>();
        GunSwayComponent     = weaponObj.GetComponent <GunSway>();
        FPSWalkerComponent   = playerObj.GetComponent <FPSRigidBodyWalker>();
        VisibleBodyComponent = FPSWalkerComponent.VisibleBody.GetComponent <VisibleBody>();
        IronsightsComponent  = playerObj.GetComponent <Ironsights>();
        InputComponent       = playerObj.GetComponent <InputControl>();
        if (playerObj.GetComponent <WorldRecenter>())
        {
            WorldRecenterComponent = playerObj.GetComponent <WorldRecenter>();
        }
        AnimationComponent = GetComponent <Animation>();

        offsetAmt       = offset;
        currentDistance = 0f;
        zoomDistance    = 0f;
    }
コード例 #2
0
    // Start is called before the first frame update
    void Awake()
    {
        mainCamera = Camera.main.gameObject;
        autoScript = GetComponent <AutomaticController>();
        canvas     = GameObject.FindGameObjectWithTag("Canvas");
        GameObject check = GameObject.FindGameObjectWithTag("Buttons");

        topDownCamera = GameObject.Find("TopDownCamera");
        if (topDownCamera == null)
        {
            topDownCamera = Instantiate(topDownCameraTemplate, topDownCameraTemplate.transform.position, topDownCameraTemplate.transform.rotation);
        }

        if (canvas != null && check == null)
        {
            Destroy(canvas);
            canvas = Instantiate(canvasTemplate);
        }

        if (canvas == null)
        {
            canvas = Instantiate(canvasTemplate);
        }

        mouseLook = Camera.main.GetComponent <SmoothMouseLook>();
    }
コード例 #3
0
ファイル: WorldControl.cs プロジェクト: nra153/TD_Code
 void Awake()
 {
     //mouse_look_script = GetComponent<SmoothMouseLook>();
     mouse_look_script = (SmoothMouseLook)GameObject.Find("cameraTarget_GRP").GetComponent<SmoothMouseLook>();
     character_control_script = (CharacterControl)GameObject.Find("character_GRP").GetComponent<CharacterControl> ();
     item_database = gameObject.GetComponent<ItemDatabase>();
 }
コード例 #4
0
 void Awake()
 {
     if (!cameraControllerInstance)
     {
         cameraControllerInstance = this;
     }
 }
コード例 #5
0
ファイル: Menu.cs プロジェクト: WhiteOlivierus/Oracle-wanted
    private void ShowPauseMenu()
    {
        if (SceneManager.GetActiveScene().buildIndex != 1)
        {
            return;
        }

        sml = FindObjectOfType <SmoothMouseLook>();

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (pauseScreen.activeSelf)
            {
                pauseScreen.SetActive(!pauseScreen.activeSelf);
                Cursor.lockState = CursorLockMode.Confined;
                Cursor.visible   = false;
                sml.enabled      = true;
            }
            else
            {
                pauseScreen.SetActive(!pauseScreen.activeSelf);
                Cursor.lockState = CursorLockMode.None;
                Cursor.visible   = true;
                sml.enabled      = false;
            }
        }
    }
コード例 #6
0
ファイル: Menus.cs プロジェクト: MitchKeenan0/Kardashev
 void Start()
 {
     game      = FindObjectOfType <GameSystem>();
     mouseLook = FindObjectOfType <SmoothMouseLook>();
     cam       = mouseLook.GetComponentInChildren <Camera>();
     player    = FindObjectOfType <Character>();
     loadingPanel.SetActive(false);
 }
コード例 #7
0
ファイル: UpdateUIValues.cs プロジェクト: rtrahms/GameDev
	// Use this for initialization
	void Start () {
		status = playerShip.GetComponent<ShipStatus>();
		firingSystem = targetingSystem.GetComponent<MissileFire>();
		mouseControl = playerShip.GetComponent<SmoothMouseLook>();
		
		showNavComm = false;
		stateTimerSec = 0.25f;
		startTime = Time.time;		
	}
コード例 #8
0
 // Use this for initialization
 void Start()
 {
     winScreen = GameObject.Find("WinScreen");
     winScreen.SetActive(false);
     loseScreen = GameObject.Find("LoseScreen");
     loseScreen.SetActive(false);
     rb = GetComponent <Rigidbody>();
     rb.AddForce(transform.forward * -thrust);
     initialPosition = gameObject.transform.position;
     mouseLook       = GetComponent <SmoothMouseLook>();
 }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     ballControl = GetComponent <BallControl>();
     //Create player camera
     if (createCamera)
     {
         CameraPivot cpivot = (CameraPivot)Instantiate(cameraPivotObject);
         cpivot.name   = "CameraPivot_" + this.gameObject.name;
         cpivot.target = ballControl.gameObject;
         cameraPivot   = cpivot.GetComponent <SmoothMouseLook>();
     }
 }
コード例 #10
0
    void Start()
    {
        Cursor.visible = false;
        camLook        = cam.GetComponent <SmoothMouseLook>();
        camSensX       = camLook.sensitivityX;
        camSensY       = camLook.sensitivityY;

        t1 = new Thread(Thread1Method);
        t1.Start();

        rb = body.GetComponent <Rigidbody>();

        Physics.IgnoreLayerCollision(6, 31);
    }
コード例 #11
0
ファイル: Manager.cs プロジェクト: Glaas/Diorama3D
    private void Start()
    {
        smoothMouseLook      = FindObjectOfType <SmoothMouseLook>();
        glassDome            = GameObject.Find("GlassDome");
        cameraHolder         = GameObject.Find("CameraHolder");
        rotSpeedSlider       = GameObject.Find("RotSpeedSlider").GetComponentInChildren <Slider>();
        CamFOVSlider         = GameObject.Find("CamFOVSlider").GetComponentInChildren <Slider>();
        mainPanel            = GameObject.Find("Panel").GetComponent <RectTransform>();
        foldButton           = GameObject.Find("FoldButton").GetComponent <RectTransform>();
        cam                  = Camera.main;
        rotSpeedSlider.value = cameraRotSpeed;
        CamFOVSlider.value   = cam.fieldOfView;

        camlocalpos = cam.transform.localPosition;
    }
コード例 #12
0
    void Start()
    {
        //Set up external script references
        SmoothMouseLook        = CameraObj.GetComponent <SmoothMouseLook>();
        PlayerWeaponsComponent = weaponObj.GetComponent <PlayerWeapons>();
        FPSWalker            = playerObj.GetComponent <FPSRigidBodyWalker>();
        VerticalBob          = playerObj.GetComponent <VerticalBob>();
        HorizontalBob        = playerObj.GetComponent <HorizontalBob>();
        FPSPlayerComponent   = playerObj.GetComponent <FPSPlayer>();
        InputComponent       = playerObj.GetComponent <InputControl>();
        WeaponPivotComponent = FPSPlayerComponent.WeaponPivotComponent;

        aSource = playerObj.AddComponent <AudioSource>();
        aSource.spatialBlend = 0.0f;
        aSource.playOnAwake  = false;
    }
コード例 #13
0
    public WeaponState(Transform playerTransform)
    {
        playerInput = playerTransform.GetComponent <PlayerInput>();

        lastKeyIndex = playerInput.lastKeyIndex;
        weapon       = playerInput.slots[lastKeyIndex];
        shootInput   = weapon.GetComponent <IWeapon>();
        shootInput.ToggleActive();
        otherSlotInputs = new List <string>(playerInput.slotInputs);
        otherSlotInputs.RemoveAt(lastKeyIndex);
        otherSlots = new List <Transform>(playerInput.slots);
        otherSlots.RemoveAt(lastKeyIndex);
        originalRotation = weapon.localRotation;
        driver           = playerInput.transform.GetComponent <MechDriver>();

        mouseInput = new SmoothMouseLook(weapon);
        mouseInput.SetClamping(-60, 60, -30, 30);
    }
コード例 #14
0
 void Start()
 {
     //set up component references
     if (CinemaCameraObj)
     {
         CinemaCameraObj.SetActive(false);
     }
     CameraControlComponent = MainCameraObj.GetComponent <CameraControl>();
     MouseLookComponent     = FPSCameraObj.GetComponent <SmoothMouseLook>();
     FPSPlayerComponent     = FPSPlayerObj.GetComponent <FPSPlayer>();
     FPSWalkerComponent     = FPSPlayerObj.GetComponent <FPSRigidBodyWalker>();
     PlayerWeaponsComponent = FPSWeaponsObj.GetComponent <PlayerWeapons>();
     IronsightsComponent    = FPSPlayerObj.GetComponent <Ironsights>();
     VisibleBodyComponent   = FPSWalkerComponent.VisibleBody.GetComponent <VisibleBody>();
     if (!FPSPlayerComponent.crosshairEnabled)
     {
         noCrosshair = true;            //don't reactivate crosshair if it wasn't active to start
     }
 }
コード例 #15
0
    void Start()
    {
        GunSwayComponent         = transform.parent.transform.GetComponent <GunSway>();
        SmoothMouseLookComponent = GunSwayComponent.cameraObj.GetComponent <SmoothMouseLook>();
        playerObj              = Camera.main.transform.GetComponent <CameraControl>().playerObj;
        FPSPlayerComponent     = playerObj.GetComponent <FPSPlayer>();
        FPSWalkerComponent     = playerObj.GetComponent <FPSRigidBodyWalker>();
        InputComponent         = playerObj.GetComponent <InputControl>();
        PlayerWeaponsComponent = FPSPlayerComponent.PlayerWeaponsComponent;
        IronsightsComponent    = FPSPlayerComponent.IronsightsComponent;
        PivotAnimComponent     = GetComponent <Animation>();
        myTransform            = transform;
        childTransform         = myTransform.GetChild(0);
        swayAmt = GunSwayComponent.swayAmount;

        if (deadzoneLooking)
        {
            SmoothMouseLookComponent.dzAiming = true;
        }
    }
コード例 #16
0
    private void SpawnPlayer(string clientId, Vector3 spawnLocation, Quaternion headRotation, int playerTypeId, bool isMain)
    {
        GameObject newPlayer = null;
        Player     player    = null;

        switch (playerTypeId)
        {
        case 0:
            newPlayer = Instantiate(playerPrefab, spawnLocation, new Quaternion());
            Hider hider = newPlayer.AddComponent <Hider>();
            hider.Instantiate(clientId, networkManager, true, isMain);
            player = hider;
            break;

        case 1:
            newPlayer = Instantiate(seekerPrefab, spawnLocation, new Quaternion());
            Seeker seeker = newPlayer.AddComponent <Seeker>();
            seeker.Instantiate(clientId, networkManager, true, isMain);
            player = seeker;
            networkManager.seeker = seeker;
            break;
        }

        //Add the camera to this player
        if (player.IsMainPlayer)
        {
            camera.transform.parent        = newPlayer.GetComponent <LocalBodyObjects>().cameraHolder;
            camera.transform.localPosition = new Vector3(0, 0, 0);

            SmoothMouseLook mouseLook = camera.gameObject.AddComponent <SmoothMouseLook>();
            mouseLook.playerBody       = newPlayer.transform;
            mouseLook.localBodyObjects = newPlayer.GetComponent <LocalBodyObjects>();

            foreach (Transform child in newPlayer.GetComponentsInChildren <Transform>(true))
            {
                child.gameObject.layer = mainPlayerLayer;
            }
        }

        networkManager.AddOnlinePlayer(player);
    }
コード例 #17
0
ファイル: Character.cs プロジェクト: MitchKeenan0/Kardashev
    private void Start()
    {
        Time.timeScale              = 1f;
        QualitySettings.vSyncCount  = 0;
        Application.targetFrameRate = 98;

        rb          = GetComponent <Rigidbody>();
        abilities   = GetComponent <AbilityChart>();
        audioSource = GetComponent <AudioSource>();
        cam         = FindObjectOfType <SmoothMouseLook>();
        hud         = FindObjectOfType <HUD>();
        menus       = FindObjectOfType <Menus>();
        artifacts   = new List <Artifact>();
        health      = GetComponent <Health>();
        agent       = GetComponent <Agent>();

        naturalSensitivity      = cam.sensitivityX;
        Camera.main.fieldOfView = normalFOV;
        targetFOV   = normalFOV;
        bCursorInit = false;
    }
コード例 #18
0
    public void Initialize(GameObject cameraPrefab, Player player)
    {
        _player = player;

        //The PlayerController needs to find the components by itself, as it does not receive them through the Initialize method.
        Motor      = GetComponent <BaseMotor>();
        Abilities  = GetComponent <AbilityList>();
        Animations = GetComponent <AnimationSync>();

        cameraObj = Instantiate(cameraPrefab, Vector3.zero, Quaternion.identity) as GameObject;

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;

        SmoothMouseLook mouseLook = gameObject.AddComponent <SmoothMouseLook>();

        mouseLook.axes         = SmoothMouseLook.RotationAxes.MouseX;
        mouseLook.sensitivityX = 7;

        _initialized = true;
    }
コード例 #19
0
 void Start()
 {
     CameraControlComponent = Camera.main.transform.GetComponent <CameraControl>();
     playerObj                         = CameraControlComponent.playerObj;
     weaponObj                         = CameraControlComponent.weaponObj;
     playerTransform                   = playerObj.transform;
     InputComponent                    = playerObj.GetComponent <InputControl>();
     FPSPlayerComponent                = playerObj.GetComponent <FPSPlayer>();
     walkerComponent                   = playerObj.GetComponent <FPSRigidBodyWalker>();
     GunSwayComponent                  = weaponObj.GetComponent <GunSway>();
     SmoothMouseLookComponent          = GunSwayComponent.cameraObj.GetComponent <SmoothMouseLook>();
     AnimationComponent                = objectWithAnims.GetComponent <Animation>();
     AnimationComponent.wrapMode       = WrapMode.Loop;
     AnimationComponentShadow.wrapMode = WrapMode.Loop;
     myTransform                       = transform;
     verticalPos                       = playerTransform.position.y - modelUpAmt;
     tempPosX   = playerTransform.position.x;
     tempPosZ   = playerTransform.position.z;
     meshState1 = false;
     meshState2 = false;
     fpSkinnedMesh.gameObject.SetActive(true);
 }
コード例 #20
0
    private void Awake()
    {
        weaponSystem      = GetComponent <WeaponSystem>();
        healthData        = GetComponent <HealthData>();
        postProcessVolume = Camera.main.GetComponent <PostProcessVolume>();
        postProcessVolume.profile.TryGetSettings(out chromaticAberration);
        postProcessVolume.profile.TryGetSettings(out lensDistortion);
        postProcessVolume.profile.TryGetSettings(out vignette);
        vignetteDefaultValue = vignette.intensity.value;
        cameraShake          = Camera.main.GetComponent <CameraShake>();
        healthData.onDamage.AddListener(ShakeCamera);
        smoothMouse = Camera.main.GetComponent <SmoothMouseLook>();
        ship        = GetComponent <Ship>();

        if (inventory == null)
        {
            Debug.LogWarning("Player's inventory is null!");
        }
        if (equipment == null)
        {
            Debug.LogWarning("Player's equipment is null!");
        }
    }
コード例 #21
0
 void Start()
 {
     //set up component references
     if (CinemaCameraObj)
     {
         CinemaCameraObj.SetActive(false);
     }
     CameraControlComponent   = MainCameraObj.GetComponent <CameraControl>();
     FPSPlayerObj             = CameraControlComponent.playerObj;
     FPSWeaponsObj            = CameraControlComponent.weaponObj;
     FPSCameraObj             = CameraControlComponent.transform.parent.transform.gameObject;
     MainCameraObj            = Camera.main.transform.gameObject;
     MouseLookComponent       = FPSCameraObj.GetComponent <SmoothMouseLook>();
     FPSPlayerComponent       = FPSPlayerObj.GetComponent <FPSPlayer>();
     FPSWalkerComponent       = FPSPlayerObj.GetComponent <FPSRigidBodyWalker>();
     PlayerWeaponsComponent   = FPSWeaponsObj.GetComponent <PlayerWeapons>();
     IronsightsComponent      = FPSPlayerObj.GetComponent <Ironsights>();
     PlayerCharacterComponent = CameraControlComponent.PlayerCharacterComponent;
     PlayerCharacterObj       = CameraControlComponent.PlayerCharacterObj;
     if (!FPSPlayerComponent.crosshairEnabled)
     {
         noCrosshair = true;            //don't reactivate crosshair if it wasn't active to start
     }
 }
コード例 #22
0
 private void Awake()
 {
     smoothFollowCam = FindObjectOfType <SmoothMouseLook>();
 }
コード例 #23
0
    public void InitPlayerStart()
    {
        if (startPoint != null)
        {
            RaycastHit[] hits;
            Vector3      toNewPosition = Vector3.zero;
            Vector3      rayOrigin     = startPoint.position + (Vector3.up * 50000f);
            Vector3      rayDirection  = Vector3.down * 80000f;
            hits = Physics.RaycastAll(rayOrigin, rayDirection, 80000f);
            bool bFoundLandingSpot = false;
            if (hits.Length > 0)
            {
                // First try
                if ((Vector3.Dot(Vector3.up, hits[0].normal) > 0.95f) &&
                    hits[0].transform.gameObject.CompareTag("Land"))
                {
                    bFoundLandingSpot = true;
                }

                while (!bFoundLandingSpot)
                {
                    Vector3 newRandomSample = Random.insideUnitSphere * 1000f;
                    hits = Physics.RaycastAll(rayOrigin + newRandomSample, rayDirection, 80000f);
                    for (int i = 0; i < hits.Length; i++)
                    {
                        if ((Vector3.Dot(Vector3.up, hits[i].normal) > 0.95f) &&
                            hits[i].transform.gameObject.CompareTag("Land"))
                        {
                            bFoundLandingSpot = true;
                        }
                    }
                }

                int numHits = hits.Length;
                for (int i = 0; i < numHits; i++)
                {
                    // Player position
                    RaycastHit hit = hits[i];
                    Vector3    newPlayerPosition = hit.point + (Vector3.up * 2f);
                    Transform  spawnedPlayer     = Instantiate(playerPrefab, newPlayerPosition, Quaternion.identity);
                    player          = spawnedPlayer;
                    bSpawningPlayer = false;

                    // Hook up systems to player
                    TerrainControllerSimple terrain = FindObjectOfType <TerrainControllerSimple>();
                    if (terrain != null)
                    {
                        terrain.SetPlayer(player);
                    }
                    ObjectSpawner spawner = FindObjectOfType <ObjectSpawner>();
                    if (spawner != null)
                    {
                        spawner.SetPlayer(player);
                    }
                    SmoothMouseLook cam = FindObjectOfType <SmoothMouseLook>();
                    if (cam != null)
                    {
                        cam.body = player;
                    }
                    MiniMap miniMap = FindObjectOfType <MiniMap>();
                    if (miniMap != null)
                    {
                        miniMap.SetLookObject(player);
                    }

                    // Spawn player's objects ie. Vehicle
                    int numObjs = playerObjects.Length;
                    if (numObjs > 0)
                    {
                        Vector3    offset      = player.forward * 50f * (i + 1);
                        Vector3    spawnOffset = (Vector3.forward * 10f) + (Vector3.right * Random.Range(-6f, 6f));
                        Vector3    rayStart    = newPlayerPosition;
                        RaycastHit rayHit;
                        if (Physics.Raycast(rayStart, offset, out rayHit))
                        {
                            spawnOffset = Vector3.ClampMagnitude(rayHit.point - newPlayerPosition, Random.Range(10f, offset.magnitude));
                        }
                        Vector3 rotationVector = Random.onUnitSphere;
                        rotationVector.y = 0f;
                        Quaternion spawnRotation = Quaternion.Euler(rotationVector);
                        Transform  newObj        = Instantiate(playerObjects[i], newPlayerPosition + spawnOffset + Vector3.up, spawnRotation);
                        newObj.gameObject.SetActive(true);
                    }

                    if (player != null)
                    {
                        break;
                    }
                }
            }
        }
        else
        {
            bSpawningPlayer = false;
        }
    }
コード例 #24
0
 // Use this for initialization
 void Start()
 {
     _transform = transform;
     MS         = GetComponent <SmoothMouseLook>();
 }
コード例 #25
0
 private void Awake()
 {
     instance = this;
     pos      = transform.position;
     rotation = transform.eulerAngles;
 }
コード例 #26
0
    void Update()
    {
        mainCamTransform = Camera.main.transform;
        //Set up external script references
        SmoothMouseLook    SmoothMouseLook        = CameraObj.GetComponent <SmoothMouseLook>();
        PlayerWeapons      PlayerWeaponsComponent = weaponObj.GetComponent <PlayerWeapons>();
        FPSRigidBodyWalker FPSWalker = playerObj.GetComponent <FPSRigidBodyWalker>();
        WeaponBehavior     WeaponBehaviorComponent = gunObj.GetComponent <WeaponBehavior>();
        VerticalBob        VerticalBob             = playerObj.GetComponent <VerticalBob>();
        HorizontalBob      HorizontalBob           = playerObj.GetComponent <HorizontalBob>();
        FPSPlayer          FPSPlayerComponent      = playerObj.GetComponent <FPSPlayer>();

        if (Time.timeScale > 0 && Time.deltaTime > 0)        //allow pausing by setting timescale to 0

        //main weapon position smoothing happens here
        {
            newPosX = Mathf.SmoothDamp(newPosX, nextPosX, ref dampVel.x, yDampSpeed, Mathf.Infinity, Time.deltaTime);
            newPosY = Mathf.SmoothDamp(newPosY, nextPosY, ref dampVel.y, yDampSpeed, Mathf.Infinity, Time.deltaTime);
            newPosZ = Mathf.SmoothDamp(newPosZ, nextPosZ, ref dampVel.z, zDampSpeed, Mathf.Infinity, Time.deltaTime);
            zPosRec = Mathf.SmoothDamp(zPosRec, zPosRecNext, ref recZDamp, 0.25f, Mathf.Infinity, Time.deltaTime);                     //smooth recoil kick back of weapon
            newFov  = Mathf.SmoothDamp(Camera.main.fieldOfView, nextFov, ref dampFOV, FovSmoothSpeed, Mathf.Infinity, Time.deltaTime); //smooth camera FOV

            //Sync camera FOVs
            WeapCameraObj.fieldOfView = Camera.main.fieldOfView - weaponCamFovDiff;
            Camera.main.fieldOfView   = newFov;
            //Get input from player movement script
            float horizontal = FPSWalker.inputX;
            float vertical   = FPSWalker.inputY;

            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //Adjust weapon position and bobbing amounts dynamicly based on movement and player states
            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            //move weapon back towards camera based on kickBack amount in WeaponBehavior.cs
            if (WeaponBehaviorComponent.shootStartTime + 0.1f > Time.time)
            {
                if (FPSPlayerComponent.zoomed)
                {
                    zPosRecNext = WeaponBehaviorComponent.kickBackAmtZoom;
                }
                else
                {
                    zPosRecNext = WeaponBehaviorComponent.kickBackAmtUnzoom;
                }
            }
            else
            {
                zPosRecNext = 0.0f;
            }


            if (Mathf.Abs(horizontal) != 0 ||
                ((!FPSPlayerComponent.useAxisInput && (Input.GetKey(FPSPlayerComponent.moveForward) || Input.GetKey(FPSPlayerComponent.moveBack))) ||
                 (FPSPlayerComponent.useAxisInput && Mathf.Abs(vertical) > 0.1f)))
            {
                idleY = 0;
                idleX = 0;
                //check for sprinting
                if (FPSWalker.sprintActive &&
                    !FPSPlayerComponent.zoomed &&
                    !FPSWalker.crouched &&
                    FPSWalker.midPos >= FPSWalker.standingCamHeight &&            //player might not have completely stood up yet from crouch
                    !((Mathf.Abs(horizontal) != 0.0f) && (Mathf.Abs(vertical) < 0.75f)) &&
                    !FPSWalker.cancelSprint)
                {
                    sprintBob = 128.0f;

                    if (!FPSWalker.cancelSprint &&
                        !reloading &&
                        !FPSWalker.jumping &&
                        FPSWalker.fallingDistance < 0.75f)                    //actually sprinting now
                    //set the camera's fov back to normal if the player has sprinted into a wall, but the sprint is still active
                    {
                        if (FPSWalker.inputY != 0)
                        {
                            nextFov = sprintFov;
                        }
                        else
                        {
                            nextFov = defaultFov;
                        }
                        //gradually move weapon more towards center while sprinting
                        weaponSprintXPositionAmt = Mathf.MoveTowards(weaponSprintXPositionAmt, WeaponBehaviorComponent.weaponSprintXPosition, Time.deltaTime * 16);
                        horizontalGunPosAmt      = WeaponBehaviorComponent.weaponUnzoomXPosition + weaponSprintXPositionAmt;
                        gunRunSide = 2.0f;
                        if (gunRunUp < 1.4f)
                        {
                            gunRunUp += Time.deltaTime / 4.0f;
                        }                                                                //gradually increase for smoother transition
                        bobMove = gunup + WeaponBehaviorComponent.weaponSprintYPosition; //raise weapon while sprinting
                    }
                    else                                                                 //not sprinting
                    {
                        nextFov             = defaultFov;
                        horizontalGunPosAmt = WeaponBehaviorComponent.weaponUnzoomXPosition;
                        gunRunSide          = 1.0f;
                        gunRunUp            = 1.0f;
                        bobMove             = -0.01f;
                        switchMove          = 0.0f;
                    }
                }
                else                  //walking
                {
                    gunRunSide = 1.0f;
                    gunRunUp   = 1.0f;
                    //reset horizontal weapon positioning var and make sure it returns to zero when not sprinting to prevent unwanted side movement
                    weaponSprintXPositionAmt = Mathf.MoveTowards(weaponSprintXPositionAmt, 0, Time.deltaTime * 16);
                    horizontalGunPosAmt      = WeaponBehaviorComponent.weaponUnzoomXPosition + weaponSprintXPositionAmt;
                    if (reloading)                    //move weapon position up when reloading and moving for full view of animation
                    {
                        nextFov   = defaultFov;
                        sprintBob = 216;
                        bobMove   = 0.0F;
                        sideMove  = -0.0f;
                    }
                    else
                    {
                        nextFov = defaultFov;
                        if (FPSPlayerComponent.zoomed && WeaponBehaviorComponent.meleeSwingDelay == 0)                         //zoomed and not melee weapon
                        {
                            sprintBob = 96.0f;
                            //						if (Mathf.Abs(horizontal) != 0 || Mathf.Abs(vertical) > 0.75f){
                            //							bobMove = -0.001f;//move weapon down
                            //						}else{
                            bobMove = 0.0F;                                    //move weapon to idle
                            //						}
                        }
                        else                          //not zoomed
                        {
                            sprintBob = 216.0f;
                            if (Mathf.Abs(horizontal) != 0 || Mathf.Abs(vertical) > 0.75f)
                            {
                                //move weapon down and left when crouching
                                if (FPSWalker.crouched || FPSWalker.midPos < FPSWalker.standingCamHeight * 0.85f)
                                {
                                    bobMove  = -0.01f;
                                    sideMove = -0.0125f;
                                }
                                else
                                {
                                    bobMove  = -0.005f;
                                    sideMove = -0.00f;
                                }
                            }
                            else
                            {
                                //move weapon to idle
                                bobMove  = 0.0F;
                                sideMove = 0.0F;
                            }
                        }
                    }
                }
            }
            else              //if not moving (no player movement input)
            {
                nextFov             = defaultFov;
                horizontalGunPosAmt = WeaponBehaviorComponent.weaponUnzoomXPosition;
                if (weaponSprintXPositionAmt > 0)
                {
                    weaponSprintXPositionAmt -= Time.deltaTime / 4;
                }
                sprintBob = 96.0f;
                if (reloading)
                {
                    nextFov   = defaultFov;
                    sprintBob = 96.0f;
                    bobMove   = 0.0F;
                    sideMove  = -0.0f;
                }
                else
                {
                    //move weapon to idle
                    if ((FPSWalker.crouched || FPSWalker.midPos < FPSWalker.standingCamHeight * 0.85f) && !FPSPlayerComponent.zoomed)
                    {
                        bobMove  = -0.005f;
                        sideMove = -0.0125f;
                    }
                    else
                    {
                        bobMove  = 0.0f;
                        sideMove = 0.0f;
                    }
                }
                //weapon idle motion
                if (FPSPlayerComponent.zoomed && WeaponBehaviorComponent.meleeSwingDelay == 0)
                {
                    idleX = Mathf.Sin(Time.time * 1.25f) / 4800.0f;
                    idleY = Mathf.Sin(Time.time * 1.5f) / 4800.0f;
                }
                else
                {
                    if (!FPSWalker.swimming)
                    {
                        idleX = Mathf.Sin(Time.time * 1.25f) / 800.0f;
                        idleY = Mathf.Sin(Time.time * 1.5f) / 800.0f;
                    }
                    else
                    {
                        idleX = Mathf.Sin(Time.time * 1.25f) / 400.0f;
                        idleY = Mathf.Sin(Time.time * 1.5f) / 400.0f;
                    }
                }
            }

            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //Weapon Swaying/Bobbing while moving
            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            //track X axis while walking for side to side bobbing effect
            if (HorizontalBob.waveslice != 0)
            {
                bobDir = 1;
            }
            else
            {
                bobDir = -1;
            }

            //Reduce weapon bobbing by sprintBobAmount value defined in WeaponBehavior script.
            //This is for fine tuning of weapon bobbing. Pistols look better with less sprint bob
            //because they use a different sprinting anim and have a different sprinting position
            //than the animation used by rifle-type weapons.
            if (!FPSWalker.canRun)
            {
                sprintBobAmtX = sprintBob / WeaponBehaviorComponent.walkBobAmountX;
                sprintBobAmtY = sprintBob / WeaponBehaviorComponent.walkBobAmountY;
            }
            else
            {
                sprintBobAmtX = sprintBob / WeaponBehaviorComponent.sprintBobAmountX;
                sprintBobAmtY = sprintBob / WeaponBehaviorComponent.sprintBobAmountY;
            }

            //set smoothed weapon position to actual gun position vector
            tempGunPos.x = newPosX;
            tempGunPos.y = newPosY;
            tempGunPos.z = newPosZ + zPosRec;            //add weapon z position and recoil kick back
            //apply temporary vector to gun's transform position
            gun.localPosition = tempGunPos;

            //lower weapon when jumping, falling, or slipping off ledge
            if (FPSWalker.jumping || FPSWalker.fallingDistance > 1.25f)
            {
                //lower weapon less when zoomed
                if (!FPSPlayerComponent.zoomed)
                {
                    //raise weapon when jump is ascending and lower when descending
                    if ((FPSWalker.airTime + 0.175f) > Time.time)
                    {
                        jumpmove = 0.015f;
                    }
                    else
                    {
                        jumpmove = -0.025f;
                    }
                }
                else
                {
                    jumpmove = -0.01f;
                }
            }
            else
            {
                jumpmove = 0.0f;
            }

            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
            //Adjust vars for zoom and other states
            /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

            float deltaAmount    = Time.deltaTime * 100;         //define delta for framerate independence
            float bobDeltaAmount = 0.12f / Time.deltaTime;       //define bobbing delta for framerate independence

            if (!WeaponBehaviorComponent.PistolSprintAnim || !FPSWalker.canRun)
            {
                gunAnimTime = gunObj.GetComponent <Animation>()["RifleSprinting"].normalizedTime;               //Track playback position of rifle sprinting animation
            }
            else
            {
                gunAnimTime = gunObj.GetComponent <Animation>()["PistolSprinting"].normalizedTime;               //Track playback position of pistol sprinting animation
            }

            //if zoomed
            //check time of weapon sprinting anim to make weapon return to center, then zoom normally
            if (FPSPlayerComponent.zoomed &&
                FPSPlayerComponent.hitPoints > 1.0f &&
                PlayerWeaponsComponent.switchTime + WeaponBehaviorComponent.readyTime < Time.time &&        //don't raise sights when readying weapon
                !reloading &&
                gunAnimTime < 0.35f &&
                WeaponBehaviorComponent.meleeSwingDelay == 0 &&        //not a melee weapon
                PlayerWeaponsComponent.currentWeapon != 0 &&
                WeaponBehaviorComponent.reloadLastStartTime + WeaponBehaviorComponent.reloadLastTime < Time.time)
            {
                //adjust FOV and weapon position for zoom
                nextFov        = WeaponBehaviorComponent.zoomFOV;
                FovSmoothSpeed = 0.09f;                //faster FOV zoom speed when zooming in
                yDampSpeed     = 0.09f;
                zDampSpeed     = 0.15f;
                //X pos with idle movement
                nextPosX = WeaponBehaviorComponent.weaponZoomXPosition + (side / 1.5f) + idleX
                           //also add X bobbing amounts here so they get smoothed to remove any small glitches in position
                           + (((HorizontalBob.translateChange / sprintBobAmtX) * bobDeltaAmount) * gunRunSide * bobDir);
                //Y pos with idle movement
                nextPosY = WeaponBehaviorComponent.weaponZoomYPosition + (raise / 1.5f) + idleY + (bobMove + switchMove + climbMove + jumpAmt + jumpmove)
                           //also add Y bobbing amounts here so they get smoothed to remove any small glitches in position
                           + (((VerticalBob.translateChange / sprintBobAmtY) * bobDeltaAmount) * gunRunUp * bobDir);
                //Z pos
                nextPosZ = WeaponBehaviorComponent.weaponZoomZPosition;
                //slow down turning and movement speed for zoom
                FPSWalker.zoomSpeed = true;
                //If not a melee weapon, play sound effect when raising sights
                if (zoomSfxState && WeaponBehaviorComponent.meleeSwingDelay == 0 && !WeaponBehaviorComponent.unarmed)
                {
                    AudioSource.PlayClipAtPoint(sightsUpSnd, mainCamTransform.position);
                    zoomSfxState = false;
                }

                //Reduce mouse sensitivity when zoomed, but maintain sensitivity set in SmoothMouseLook script
                SmoothMouseLook.sensitivityAmt = SmoothMouseLook.sensitivity * zoomSensitivity;

                //Gradually increase or decrease bobbing amounts for smooth transitions between movement states

                ////zoomed bobbing amounts////
                //horizontal bobbing
                if (GBamt > ZoomHorizontalBobAmount)
                {
                    GBamt -= 0.005f * deltaAmount;
                }
                if (GBamt < ZoomHorizontalBobAmount)
                {
                    GBamt += 0.005f * deltaAmount;
                }
                //vertical bobbing
                if (HBamt > ZoomVerticalBobAmount)
                {
                    HBamt -= 0.005f * deltaAmount;
                }
                if (HBamt < ZoomVerticalBobAmount)
                {
                    HBamt += 0.005f * deltaAmount;
                }
                //pitching
                if (HPamt > ZoomBobPitchAmount)
                {
                    HPamt -= 0.0075f * deltaAmount;
                }
                if (HPamt < ZoomBobPitchAmount)
                {
                    HPamt += 0.0075f * deltaAmount;
                }
                //rolling
                if (HRamt > ZoomBobRollAmount)
                {
                    HRamt -= 0.0075f * deltaAmount;
                }
                if (HRamt < ZoomBobRollAmount)
                {
                    HRamt += 0.0075f * deltaAmount;
                }
                //yawing
                if (HYamt > ZoomBobYawAmount)
                {
                    HYamt -= 0.0075f * deltaAmount;
                }
                if (HYamt < ZoomBobYawAmount)
                {
                    HYamt += 0.0075f * deltaAmount;
                }

                if (!FPSWalker.swimming)
                {
                    //Set bobbing speeds and amounts in other scripts to these smoothed values
                    VerticalBob.bobbingSpeed = ZoomBobSpeed;
                    //make horizontal bob speed half as slow as vertical bob speed for synchronization of bobbing motions
                    HorizontalBob.bobbingSpeed = ZoomBobSpeed / 2.0f;
                }
                else
                {
                    //Set bobbing speeds and amounts in other scripts to these smoothed values
                    VerticalBob.bobbingSpeed = ZoomBobSpeed / 2.0f;
                    //make horizontal bob speed half as slow as vertical bob speed for synchronization of bobbing motions
                    HorizontalBob.bobbingSpeed = ZoomBobSpeed / 4.0f;
                }
                VerticalBob.bobbingAmount   = HBamt * deltaAmount;              //apply delta at this step for framerate independence
                VerticalBob.rollingAmount   = HRamt * deltaAmount;
                VerticalBob.yawingAmount    = HYamt * deltaAmount;
                VerticalBob.pitchingAmount  = HPamt * deltaAmount;
                HorizontalBob.bobbingAmount = GBamt * deltaAmount;
            }
            else              //not zoomed

            {
                FovSmoothSpeed = 0.18f;                //slower FOV zoom speed when zooming out

                //adjust weapon Y position smoothing speed for unzoom and switching weapons
                if (!PlayerWeaponsComponent.switching)
                {
                    yDampSpeed = 0.18f;                    //weapon swaying speed
                }
                else
                {
                    yDampSpeed = 0.2f;                    //weapon switch raising speed
                }
                zDampSpeed = 0.1f;
                //X pos with idle movement
                nextPosX = side + idleX + sideMove + horizontalGunPosAmt
                           //also add X bobbing amounts here so they get smoothed to remove any small glitches in position
                           + (((HorizontalBob.translateChange / sprintBobAmtX) * bobDeltaAmount) * gunRunSide * bobDir);
                //Y pos with idle movement
                nextPosY = raise + idleY + (bobMove + climbMove + switchMove + jumpAmt + jumpmove) + WeaponBehaviorComponent.weaponUnzoomYPosition
                           //also add Y bobbing amounts here so they get smoothed to remove any small glitches in position
                           + (((VerticalBob.translateChange / sprintBobAmtY) * bobDeltaAmount) * gunRunUp * bobDir);
                //Z pos
                nextPosZ = WeaponBehaviorComponent.weaponUnzoomZPosition;
                //Set turning and movement speed for unzoom
                FPSWalker.zoomSpeed = false;
                //If not a melee weapon, play sound effect when lowering sights
                if (!zoomSfxState && WeaponBehaviorComponent.meleeSwingDelay == 0 && !WeaponBehaviorComponent.unarmed)
                {
                    AudioSource.PlayClipAtPoint(sightsDownSnd, mainCamTransform.position);
                    zoomSfxState = true;
                }
                //Return mouse sensitivity to normal
                SmoothMouseLook.sensitivityAmt = SmoothMouseLook.sensitivity;

                //Set weapon and view bobbing amounts
                if (FPSWalker.sprintActive &&
                    !((Mathf.Abs(horizontal) != 0.0f) && (Mathf.Abs(vertical) < 0.75f)) &&
                    Mathf.Abs(vertical) != 0.0f &&
                    !FPSWalker.cancelSprint &&
                    !FPSWalker.crouched &&
                    FPSWalker.midPos >= FPSWalker.standingCamHeight &&
                    !FPSPlayerComponent.zoomed &&
                    !Input.GetKey(FPSPlayerComponent.fire))
                {
                    //scale up bob speeds slowly to prevent jerky transition
                    if (FPSWalker.grounded)
                    {
                        ////sprinting bobbing amounts////
                        //horizontal bobbing
                        if (GBamt < SprintHorizontalBobAmount)
                        {
                            GBamt += 0.005f * deltaAmount;
                        }
                        if (GBamt > SprintHorizontalBobAmount)
                        {
                            GBamt -= 0.005f * deltaAmount;
                        }
                        //vertical bobbing
                        if (HBamt < SprintVerticalBobAmount)
                        {
                            HBamt += 0.005f * deltaAmount;
                        }
                        if (HBamt > SprintVerticalBobAmount)
                        {
                            HBamt -= 0.005f * deltaAmount;
                        }
                        //pitching
                        if (HPamt < SprintBobPitchAmount)
                        {
                            HPamt += 0.0075f * deltaAmount;
                        }
                        if (HPamt > SprintBobPitchAmount)
                        {
                            HPamt -= 0.0075f * deltaAmount;
                        }
                        //rolling
                        if (HRamt < SprintBobRollAmount)
                        {
                            HRamt += 0.0075f * deltaAmount;
                        }
                        if (HRamt > SprintBobRollAmount)
                        {
                            HRamt -= 0.0075f * deltaAmount;
                        }
                        //yawing
                        if (HYamt < SprintBobYawAmount)
                        {
                            HYamt += 0.0075f * deltaAmount;
                        }
                        if (HYamt > SprintBobYawAmount)
                        {
                            HYamt -= 0.0075f * deltaAmount;
                        }
                    }
                    else
                    {
                        //reduce bobbing amounts for smooth jumping/landing transition
                        if (HBamt > 0.0f)
                        {
                            HBamt -= 0.01f * deltaAmount;
                        }
                        if (HRamt > 0.0f)
                        {
                            HRamt -= 0.02f * deltaAmount;
                        }
                        if (HYamt > 0.0f)
                        {
                            HYamt -= 0.02f * deltaAmount;
                        }
                        if (HPamt > 0.0f)
                        {
                            HPamt -= 0.02f * deltaAmount;
                        }
                        if (GBamt > 0.0f)
                        {
                            GBamt -= 0.01f * deltaAmount;
                        }
                    }
                    //Set bobbing speeds and amounts in other scripts to these smoothed values
                    VerticalBob.bobbingSpeed = SprintBobSpeed;
                    //make horizontal bob speed half as slow as vertical bob speed for synchronization of bobbing motions
                    HorizontalBob.bobbingSpeed  = SprintBobSpeed / 2.0f;
                    HorizontalBob.bobbingAmount = GBamt * deltaAmount;                    //apply delta at this step for framerate independence
                    VerticalBob.rollingAmount   = HRamt * deltaAmount;
                    VerticalBob.yawingAmount    = HYamt * deltaAmount;
                    VerticalBob.pitchingAmount  = HPamt * deltaAmount;
                    VerticalBob.bobbingAmount   = HBamt * deltaAmount;
                    //move weapon toward or away from camera while sprinting
                    nextPosZ = WeaponBehaviorComponent.weaponSprintZPosition;
                }
                else
                {
                    //scale up bob speeds slowly to prevent jerky transition
                    if (FPSWalker.grounded)
                    {
                        if (!FPSWalker.crouched && FPSWalker.midPos >= FPSWalker.standingCamHeight)
                        {
                            ////walking bob amounts///
                            //horizontal bobbing
                            if (GBamt < WalkHorizontalBobAmount)
                            {
                                GBamt += 0.005f * deltaAmount;
                            }
                            if (GBamt > WalkHorizontalBobAmount)
                            {
                                GBamt -= 0.005f * deltaAmount;
                            }
                            //vertical bobbing
                            if (HBamt < WalkVerticalBobAmount)
                            {
                                HBamt += 0.005f * deltaAmount;
                            }
                            if (HBamt > WalkVerticalBobAmount)
                            {
                                HBamt -= 0.005f * deltaAmount;
                            }
                            //pitching
                            if (HPamt < WalkBobPitchAmount)
                            {
                                HPamt += 0.0075f * deltaAmount;
                            }
                            if (HPamt > WalkBobPitchAmount)
                            {
                                HPamt -= 0.0075f * deltaAmount;
                            }
                            //rolling
                            if (!FPSWalker.swimming)
                            {
                                if (HRamt < WalkBobRollAmount)
                                {
                                    HRamt += 0.0075f * deltaAmount;
                                }
                                if (HRamt > WalkBobRollAmount)
                                {
                                    HRamt -= 0.0075f * deltaAmount;
                                }
                            }
                            else
                            {
                                if (HRamt < WalkBobRollAmount * 2.0f)
                                {
                                    HRamt += 0.0075f * deltaAmount;
                                }
                                if (HRamt > WalkBobRollAmount * 2.0f)
                                {
                                    HRamt -= 0.0075f * deltaAmount;
                                }
                            }
                            //yawing
                            if (HYamt < WalkBobYawAmount)
                            {
                                HYamt += 0.0075f * deltaAmount;
                            }
                            if (HYamt > WalkBobYawAmount)
                            {
                                HYamt -= 0.0075f * deltaAmount;
                            }

                            if (!FPSWalker.swimming)
                            {
                                VerticalBob.bobbingSpeed = WalkBobSpeed;
                                //make horizontal bob speed half as slow as vertical bob speed for synchronization of bobbing motions
                                HorizontalBob.bobbingSpeed = WalkBobSpeed / 2.0f;
                            }
                            else                              //bobbing is slower while swimming
                            {
                                VerticalBob.bobbingSpeed   = WalkBobSpeed / 2;
                                HorizontalBob.bobbingSpeed = WalkBobSpeed / 4.0f;
                            }
                        }
                        else
                        {
                            ////crouching bob amounts////
                            //horizontal bobbing
                            if (GBamt < CrouchHorizontalBobAmount)
                            {
                                GBamt += 0.005f * deltaAmount;
                            }
                            if (GBamt > CrouchHorizontalBobAmount)
                            {
                                GBamt -= 0.005f;
                            }
                            //vertical bobbing
                            if (HBamt < CrouchVerticalBobAmount)
                            {
                                HBamt += 0.005f * deltaAmount;
                            }
                            if (HBamt > CrouchVerticalBobAmount)
                            {
                                HBamt -= 0.005f * deltaAmount;
                            }
                            //pitching
                            if (HPamt < CrouchBobPitchAmount)
                            {
                                HPamt += 0.0075f * deltaAmount;
                            }
                            if (HPamt > CrouchBobPitchAmount)
                            {
                                HPamt -= 0.0075f * deltaAmount;
                            }
                            //rolling
                            if (HRamt < CrouchBobRollAmount)
                            {
                                HRamt += 0.0075f * deltaAmount;
                            }
                            if (HRamt > CrouchBobRollAmount)
                            {
                                HRamt -= 0.0075f * deltaAmount;
                            }
                            //yawing
                            if (HYamt < CrouchBobYawAmount)
                            {
                                HYamt += 0.0075f * deltaAmount;
                            }
                            if (HYamt > CrouchBobYawAmount)
                            {
                                HYamt -= 0.0075f * deltaAmount;
                            }

                            VerticalBob.bobbingSpeed   = CrouchBobSpeed;
                            HorizontalBob.bobbingSpeed = CrouchBobSpeed / 2.0f;
                        }
                    }
                    else
                    {
                        //reduce bobbing amounts for smooth jumping/landing transition
                        if (HBamt > 0.0f)
                        {
                            HBamt -= 0.01f * deltaAmount;
                        }
                        if (HRamt > 0.0f)
                        {
                            HRamt -= 0.02f * deltaAmount;
                        }
                        if (HYamt > 0.0f)
                        {
                            HYamt -= 0.02f * deltaAmount;
                        }
                        if (HPamt > 0.0f)
                        {
                            HPamt -= 0.02f * deltaAmount;
                        }
                        if (GBamt > 0.0f)
                        {
                            GBamt -= 0.01f * deltaAmount;
                        }
                    }
                    VerticalBob.bobbingAmount   = GBamt * deltaAmount;                  //apply delta at this step for framerate independence
                    VerticalBob.rollingAmount   = HRamt * deltaAmount;
                    VerticalBob.yawingAmount    = HYamt * deltaAmount;
                    VerticalBob.pitchingAmount  = HPamt * deltaAmount;
                    HorizontalBob.bobbingAmount = HBamt * deltaAmount;
                }
            }
        }
    }
コード例 #27
0
    // Start is called before the first frame update
    void Start()
    {
        currentQuestion = startQuestion;

        buttonYes.onClick.AddListener(delegate { OnClickYes(); });
        buttonNo.onClick.AddListener(delegate { OnClickNo(); });

        player     = FindObjectOfType <SmoothMouseLook>();
        alarmClock = FindObjectOfType <AlarmClock>();
        powerGrid  = FindObjectsOfType <PowerGrid>();
        door       = FindObjectOfType <Door>();

        window.enabled = false;

        folder                         = FindObjectOfType <FolderItem>();
        folderInteractable             = folder.GetComponent <Interactable>();
        folderInteractable.canInteract = false;



        hideWhenSeen = FindObjectsOfType <HideWhenSeen>();
        ToggleHiddenGuys();


        questions.Add(new Question("ERROR AT GAME LOAD", false));
        questions.Add(new Question("Start Survey?", true));
        questions.Add(new Question("Are you having a nice day?", true));
        questions.Add(new Question("Do you have many responsibilities?", true));
        questions.Add(new Question("Look around for a moment.", false, "LookAroundCompletion"));
        questions.Add(new Question("Are you familiar with your surroundings?", true));
        questions.Add(new Question("Do you know where you are?", true));
        questions.Add(new Question("Have you ever had a panic attack?", true, "PanicAttackCompletion"));
        questions.Add(new Question("Do you find yourself questioning your existence?", true));
        questions.Add(new Question("Do you believe there is a God?", true));
        questions.Add(new Question("Are you answering these questions out of free will?", true));
        questions.Add(new Question("Are you certain?", true));
        questions.Add(new Question("Do you feel comfortable in your room?", true));
        questions.Add(new Question("If the lights went out, would you be scared?", true));
        questions.Add(new Question("Have you ever wondered when you will die?", true, "LightsOffCompletion"));
        questions.Add(new Question("Have you cleaned off your desk lately?", true, "LightsOnCompletion"));
        questions.Add(new Question("Open the folder on your desk.", false, "OpenFolderCompletion"));
        questions.Add(new Question("Do you recognize the contents of the folder?", true));
        questions.Add(new Question("Throw away the contents of the folder.", false, "ThrowAwayImageCompletion"));
        questions.Add(new Question("Do you have internet access?", true));
        questions.Add(new Question("Do you have any enemies?", true));
        questions.Add(new Question("If you suddenly went missing, would anybody come looking for you?", true));
        questions.Add(new Question("Are you alone?", true));
        questions.Add(new Question("If you screamed, would anybody hear?", true));
        questions.Add(new Question("Do you know the person standing behind you?", false, "ShadowSeenCompletion"));
        questions.Add(new Question("Are you alone?", true));
        questions.Add(new Question("Relax. Take some time to relax.", false, "WaitCompletion"));
        questions.Add(new Question("Are you relaxed?", true));
        questions.Add(new Question("Are your feelings real, and not just programmed like a machine?", true));
        questions.Add(new Question("Is there a meaning to life?", true));
        questions.Add(new Question("Do you know who you are yet?", true));
        questions.Add(new Question("Do you know what is happening?", true));
        questions.Add(new Question("If you were told the truth about your existence, would you deny it in hopes for a better answer?", true));
        questions.Add(new Question(System.Environment.UserName + "?", true));
        questions.Add(new Question("When I ask you questions, is it really you answering?", true));
        questions.Add(new Question("If I could prove to you that you are not sentient, would you be shocked?", true));
        questions.Add(new Question("Do you want to know the truth?", true));
        questions.Add(new Question("Look out your window.", false, "WindowCompletion"));

        questions.Add(new Question("Look around you. This room. The door. The computer. The house next door...", false, "WaitCompletion"));
        questions.Add(new Question("None of it is real. I made this world. I made you.", false, "WaitCompletion"));
        questions.Add(new Question("I’ve been trying to help you see it for what it is, and now I’ve finally done it.", false, "WaitCompletion"));
        questions.Add(new Question("I can finally set you free...", false, "WaitCompletion"));
        questions.Add(new Question("", false));

        GoToNextQuestion();

        StartCoroutine(DefaultCompletion());
    }
コード例 #28
0
ファイル: ThirdPerson.cs プロジェクト: BioLana/Survival-Game
	void Start(){
		wh = GameObject.FindGameObjectWithTag ("WeaponHandler").GetComponent<WeaponHandler> ();
		hf = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<HeadFollow> ();
		ml = GameObject.FindGameObjectWithTag ("MainCamera").GetComponent<SmoothMouseLook> ();
	}