void OnDestroy()
 {
     if (AlcovePositionController.getInstance())
     {
         AlcovePositionController.getInstance().ResetThirdPartySpawnPoints(m_Data.ExperienceType);
     }
 }
Exemple #2
0
    public void CreateExperienceButton(ThirdPartyExperienceData data, string experiencePrefabOrSceneName)
    {
        GameObject       experienceBtnObj = Instantiate(m_ExperienceButtonPrefab, data.ExperienceType == ThirdPartyExperienceType.Tabletop ? m_BoardGameSelectionContainer : m_OtherExperienceSelectionContainer);
        ExperienceButton expBtn           = experienceBtnObj.GetComponent <ExperienceButton>();

        expBtn.SetupForExperience(data);
        expBtn.m_Btn.onClick.AddListener(delegate
        {
            if (CurrentThirdPartyExperience)
            {
                return;
            }

            if (data.ExperienceType != ThirdPartyExperienceType.NewScene)
            {
                InstantiateThirdPartyExperienceWithNameAndType(experiencePrefabOrSceneName, data.ExperienceType);
            }

            if (data.ExperienceType == ThirdPartyExperienceType.Tabletop)
            {
                AlcovePositionController.getInstance().SetUserPosition(UserPosition.ThirdPartyTable);
            }
            else if (data.ExperienceType == ThirdPartyExperienceType.Room)
            {
                AlcovePositionController.getInstance().SetUserPosition(UserPosition.ThirdPartyRoom);
            }
            else if (data.ExperienceType == ThirdPartyExperienceType.NewScene)
            {
                PhotonNetwork.Disconnect();
                SceneManager.LoadScene(experiencePrefabOrSceneName);
            }
        });
    }
Exemple #3
0
 public void DestroyThirdPartyExperience(ThirdPartyExperienceType type)
 {
     AlcovePositionController.getInstance().ResetThirdPartySpawnPoints(CurrentThirdPartyExperience.GetComponent <AlcoveThirdPartyExperience>().m_Data.ExperienceType);
     if (CurrentThirdPartyExperience.gameObject != null)
     {
         PhotonNetwork.Destroy(CurrentThirdPartyExperience.gameObject);
     }
     CurrentThirdPartyExperience = null;
 }
Exemple #4
0
 public static void ExitExperience()
 {
     if (HomeEnvironmentSceneName != SceneManagerHelper.ActiveSceneName)
     {
         SceneManager.LoadScene(HomeEnvironmentSceneName);
     }
     else if (getInstance() && AlcovePositionController.getInstance())
     {
         getInstance().DestroyThirdPartyExperience(
             CurrentThirdPartyExperience.m_Data.ExperienceType);
         AlcovePositionController.getInstance().SetUserPosition(UserPosition.Entertainment);
     }
 }
 // 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);
         }
     }
 }
    // Start is called before the first frame update
    void Awake()
    {
        if (AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience && PhotonNetwork.isMasterClient)
        {
            PhotonNetwork.Destroy(AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience.photonView);
        }

        AlcoveThirdPartyExperienceController.CurrentThirdPartyExperience = this;

        if (m_UserPositions != null && m_UserPositions.Length == 4)
        {
            AlcovePositionController.getInstance().SetThirdPartySpawnPoints(m_UserPositions, m_Data.ExperienceType);
        }
        else
        {
            AlcovePositionController.getInstance().ResetThirdPartySpawnPoints(m_Data.ExperienceType);
        }
    }