コード例 #1
0
    public override void Initialize()
    {
        base.Initialize();

        if (isInit)
        {
            return;
        }

        activeFeature = true;

        isInit = true;

        BIWCatalogManager.Init();

        CreateControllers();
        InitReferences();


        if (builderInWorldBridge != null)
        {
            builderInWorldBridge.OnCatalogHeadersReceived += CatalogHeadersReceived;
            builderInWorldBridge.OnBuilderProjectInfo     -= BuilderProjectPanelInfo;
        }

        userProfile = UserProfile.GetOwnUserProfile();
        if (!string.IsNullOrEmpty(userProfile.userId))
        {
            updateLandsWithAcessCoroutine = CoroutineStarter.Start(CheckLandsAccess());
        }
        else
        {
            userProfile.OnUpdate += OnUserProfileUpdate;
        }

        InitHUD();

        BIWTeleportAndEdit.OnTeleportEnd += OnPlayerTeleportedToEditScene;

        ConfigureLoadingController();
        InitControllers();

        CommonScriptableObjects.builderInWorldNotNecessaryUIVisibilityStatus.Set(true);

        builderInWorldBridge.AskKernelForCatalogHeaders();

        isCatalogLoading = true;
        BIWNFTController.i.Initialize();
        BIWNFTController.i.OnNFTUsageChange += OnNFTUsageChange;

        editModeChangeInputAction              = context.inputsReferencesAsset.editModeChangeInputAction;
        editModeChangeInputAction.OnTriggered += ChangeEditModeStatusByShortcut;

        biwAudioHandler = GameObject.Instantiate(context.projectReferencesAsset.audioPrefab, Vector3.zero, Quaternion.identity).GetComponent <BuilderInWorldAudioHandler>();
        biwAudioHandler.SetReferences(context);
        biwAudioHandler.gameObject.SetActive(false);
    }