// OnInspector GUI
    public override void OnInspectorGUI() //2
    {
        base.DrawDefaultInspector();

        if (GUILayout.Button("SetPosition")) //8
        {
            AlcoveThirdPartyExperience           script = (AlcoveThirdPartyExperience)target;
            AlcoveThirdPartyExperienceController experienceController = FindObjectOfType <AlcoveThirdPartyExperienceController>();
            if (experienceController == null)
            {
                Debug.LogError("No Third Party Experience Controller found in scene.");
            }

            if (script.m_Data.ExperienceType == ThirdPartyExperienceType.Room && experienceController.m_RoomExperienceTransform == null)
            {
                Debug.LogError("No transform for Room type assigned to the ThirdPartyExperienceController.");
            }
            else if (script.m_Data.ExperienceType == ThirdPartyExperienceType.Room)
            {
                script.transform.position = experienceController.m_RoomExperienceTransform.position;
                script.transform.rotation = experienceController.m_RoomExperienceTransform.rotation;
            }

            else if (script.m_Data.ExperienceType == ThirdPartyExperienceType.Tabletop && experienceController.m_RoomExperienceTransform == null)
            {
                Debug.LogError("No transform for Tabletop type assigned to the ThirdPartyExperienceController.");
            }
            else if (script.m_Data.ExperienceType == ThirdPartyExperienceType.Tabletop)
            {
                script.transform.position = experienceController.m_TableExperienceTransform.position;
                script.transform.rotation = experienceController.m_TableExperienceTransform.rotation;
            }
        }
    }
Beispiel #2
0
 // Update is called once per frame
 void Update()
 {
     if (OVRInput.GetDown(OVRInput.Button.Two))
     {
         AlcoveThirdPartyExperienceController.ReturnToHomeEnvironment();
     }
 }
    public void SetUserPosition(UserPosition position, int posIndex, Action callback = null)
    {
        //Check if we need to destroy the room experience
        if ((CurrentUserPosition == UserPosition.ThirdPartyRoom ||
             CurrentUserPosition == UserPosition.ThirdPartyTable) && position != CurrentUserPosition && AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience != null && AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience.photonView.isMine)
        {
            ThirdPartyExperienceType type = CurrentUserPosition == UserPosition.ThirdPartyRoom
                ? ThirdPartyExperienceType.Room
                : ThirdPartyExperienceType.Tabletop;

            NotificationPanel.NotificationData notificationData = new NotificationPanel.NotificationData();
            notificationData.AcceptButtonText = "Ok";
            notificationData.CancelButtonText = "Cancel";
            notificationData.HeaderText       = "Leaving game";
            notificationData.MessageText      = "If you leave the table, the game will end!";
            notificationData.AcceptCallback   = delegate
            {
                AlcoveThirdPartyExperienceController.getInstance().DestroyThirdPartyExperience(type);
                SetUserPosition(position, callback);
            };

            NotificationPanel.getInstance().ShowNotification(notificationData, true);
            return;
        }

        if (MinorTeleportationLocation.CurrentPositionCollider)
        {
            MinorTeleportationLocation.CurrentPositionCollider.enabled = true;
        }

        CurrentUserPosition      = position;
        CurrentUserPositionIndex = posIndex;

        m_CurrentUserPositionTransform = SetObjectPosition(CameraController.CameraContainer, position, posIndex);

        //Setup room colliders
        m_FamilyRoomCollider.enabled         = CurrentUserPosition != UserPosition.Family;
        m_EntertainmentAreaCollider.enabled  = CurrentUserPosition != UserPosition.Entertainment;
        m_TravelAreaCollider.enabled         = CurrentUserPosition != UserPosition.Travel;
        m_HealthAreaCollider.enabled         = CurrentUserPosition != UserPosition.Health;
        m_ThirdPartyTableCollider.enabled    = CurrentUserPosition != UserPosition.ThirdPartyTable;
        m_ThirdPartyRoomCollider.enabled     = CurrentUserPosition != UserPosition.ThirdPartyRoom;
        m_ThirdPartyRoomExitCollider.enabled = CurrentUserPosition == UserPosition.ThirdPartyRoom;

        HideAllTeleportationGraphics();

        callback?.Invoke();

        if (m_OnPositionChanged != null)
        {
            m_OnPositionChanged(CurrentUserPosition, CurrentUserPositionIndex);
        }
    }
Beispiel #4
0
 void Update()
 {
     //  Debug.Log(currentWord);
     StartUs();
     if (OVRInput.GetDown(OVRInput.Button.Two))
     {
         AlcoveThirdPartyExperienceController.ReturnToHomeEnvironment();
     }
     if (PhotonNetwork.isMasterClient && PhotonNetwork.playerList.Length == 1)
     {
         UISolveText.text = "Waiting for second player";
     }
 }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape))
     {
         if (AlcoveThirdPartyExperienceController.HomeEnvironmentSceneName != SceneManagerHelper.ActiveSceneName)
         {
             SceneManager.LoadScene(AlcoveThirdPartyExperienceController.HomeEnvironmentSceneName);
         }
         else if (AlcoveThirdPartyExperienceController.getInstance() && AlcovePositionController.getInstance())
         {
             AlcoveThirdPartyExperienceController.getInstance().DestroyThirdPartyExperience(
                 AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience.m_Data.ExperienceType);
             AlcovePositionController.getInstance().SetUserPosition(UserPosition.Entertainment);
         }
     }
 }
    public void SetPlayerPosition(PhotonPlayer player)
    {
        if (m_PlayerAvatars == null || player == null)
        {
            return;
        }

        int posIndex = 0;

        if (player.CustomProperties.ContainsKey("EnvironmentPositionIndex"))
        {
            posIndex = (int)player.CustomProperties["EnvironmentPositionIndex"];
        }

        int locationIndex = 0;

        if (player.CustomProperties.ContainsKey("EnvironmentLocation"))
        {
            locationIndex = (int)player.CustomProperties["EnvironmentLocation"];
        }

        UserPosition userPosition = (UserPosition)locationIndex;

        if (m_PlayerAvatars.ContainsKey(player.ID) && m_PlayerAvatars[player.ID] != null && m_PositionController != null)
        {
            m_PositionController.SetObjectPosition(m_PlayerAvatars[player.ID].gameObject, userPosition, posIndex);
        }

        if (userPosition == UserPosition.ThirdPartyRoom || userPosition == UserPosition.ThirdPartyTable)
        {
            AlcoveThirdPartyExperienceController.AssignPlayerToThirdPartyExperiencePosition(player, locationIndex);
        }
        else if (AlcoveThirdPartyExperienceController.PlayersInExperience.ContainsKey(player))
        {
            AlcoveThirdPartyExperienceController.RemovePlayerFromThirdPartyExperience(player);
        }
    }
Beispiel #7
0
 public void LoadHomeScene()
 {
     AlcoveThirdPartyExperienceController.ReturnToHomeEnvironment();
 }
 public void OnPointerDown(PointerEventData eventData)
 {
     AlcoveThirdPartyExperienceController.ExitExperience();
 }