Beispiel #1
0
 void Start()
 {
     playerController           = player.GetComponent <CustomRigidbodyFPSController> ();
     portalAudio                = GetComponent <AudioSource>();
     glitchValueGeneratorScript = GetComponent <GlitchValueGenerator>();
     portalAudio.clip           = glitchSound;
     portalAudio.loop           = true;
 }
Beispiel #2
0
 /// <summary>
 /// Sets the starting position and rotational value of the object upon start.
 /// </summary>
 void Start()
 {
     Player                = null;
     playerController      = null;
     mainCamera            = null;
     isInspecting          = false;
     StartPos              = gameObject.transform.position;
     originalRotationValue = gameObject.transform.rotation;
     Brackets              = GameObject.FindGameObjectWithTag("BracketArea");
     datapadAudio          = GetComponent <DatapadAudio>();
     textUI                = FindObjectOfType <DatapadTextSingleton>().gameObject.GetComponentInChildren <Text>();
 }
Beispiel #3
0
 private void Start()
 {
     if (Camera == null)
     {
         Camera = GetComponent <Camera>();
     }
     if (rigidbodyFirstPersonController == null)
     {
         rigidbodyFirstPersonController = transform.root.GetComponentInChildren <CustomRigidbodyFPSController>();
     }
     motionBob.Setup(Camera, StrideInterval);
     m_OriginalCameraPosition = Camera.transform.localPosition;
 }
Beispiel #4
0
    /// <summary>
    /// Sets the starting position and rotational value of the object upon start.
    /// </summary>
    void Start()
    {
        Player                = null;
        playerController      = null;
        mainCamera            = null;
        isInspecting          = false;
        StartPos              = gameObject.transform.position;
        originalRotationValue = gameObject.transform.rotation;
        Brackets              = GameObject.FindGameObjectWithTag("BracketArea");
        InteractionUI         = GameObject.FindGameObjectWithTag("InteractionUI");

        if (InteractionUI != null)
        {
            scrollImage         = InteractionUI.GetComponentInChildren <Image>();
            scrollImage.enabled = false;
        }
    }
Beispiel #5
0
    public void Interact(GameObject agentInteracting)
    {
        //Checks the timescale. Prevents interacting when one pause or about to pause
        if (Time.timeScale == 1.0f)
        {
            if (isInspecting)
            {
                //Resets the player to Null after the leaving the inspection  Activates the Brackets

                if (Brackets != null)
                {
                    Brackets.SetActive(true);
                }

                FinishInspect();

                if (InteractionUI != null)
                {
                    scrollImage.enabled = false;
                }
            }
            else
            {
                //If there are no objects being inspected, then begin inspecting one
                if (currentlyInspecting == false)
                {
                    //Sets the player to the agentInteracting.
                    Player = agentInteracting;
                    //Calls for the player Controller script from the Player.
                    playerController = Player.GetComponent <CustomRigidbodyFPSController> ();
                    //Calls for the camera component from the player.
                    mainCamera = Player.GetComponentInChildren <Camera> ();
                    //Disables The Brackets
                    if (Brackets != null)
                    {
                        Brackets.SetActive(false);
                    }

                    //Set to true to enable the inspection sequence.
                    isInspecting = true;
                }
            }
        }
    }
Beispiel #6
0
    // Use this for initialization
    void Start()
    {
        #region Defining Private Fields
        // Defines Camera, fpscontroller, and InteractionBehavior for roomba and player objects
        playerCam = player.GetComponentInChildren <Camera>();
        roombaCam = roomba.GetComponentInChildren <Camera>();

        playerController = player.GetComponent <CustomRigidbodyFPSController>();
        roombaController = roomba.GetComponent <CustomRigidbodyFPSController>();

        playerInteractionBehavior = player.GetComponentInChildren <InteractWithSelectedObject>();
        roombaInteractionBehavior = roomba.GetComponentInChildren <InteractWithSelectedObject>();

        playerDetectInteractionBehavior = player.GetComponentInChildren <DetectInteractableObject>();
        roombaDetectInteractionBehavior = roomba.GetComponentInChildren <DetectInteractableObject>();

        playerCanvas = player.GetComponentInChildren <Canvas>();
        roombaCanvas = roomba.GetComponentInChildren <Canvas>();

        playerBrackets = player.GetComponentInChildren <Brackets>();
        roombaBrackets = roomba.GetComponentInChildren <Brackets>();

        swapEnabled = false;
        #endregion

        // Sets the Roomba and player as active or inactive
        if (roombaIsActive)
        {
            ActivateRoomba();
        }
        else // Sets roomba to inactive, player inactive
        {
            DeactivateRoomba();
        }
        swapCanvas.enabled = false;
    }
Beispiel #7
0
 // Use this for initialization
 private void Start()
 {
     playerControllerScript = GetComponent <CustomRigidbodyFPSController>();
     footstepsAudio         = GetComponent <AudioSource>();
 }
Beispiel #8
0
 private void setFPSControllerAndCamera(CustomRigidbodyFPSController FPSController)
 {
     this.fpsController         = FPSController;
     playerCam                  = fpsController.GetComponentInChildren <Camera>();
     this.playerObjectDetection = playerCam.GetComponent <DetectInteractableObject>();
 }