Exemplo n.º 1
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;
    }
Exemplo n.º 2
0
 private void setFPSControllerAndCamera(CustomRigidbodyFPSController FPSController)
 {
     this.fpsController         = FPSController;
     playerCam                  = fpsController.GetComponentInChildren <Camera>();
     this.playerObjectDetection = playerCam.GetComponent <DetectInteractableObject>();
 }