public override void Init()
        {
            playerController          = FindObjectOfType <PlayerController>();
            amountOfSelectableWeapons = inventoryData.maxInventoryWeaponsAmount;
            equipSelectedWeaponsButton.onClick.AddListener(EquipPlayer);
            moveToMousePosController = FindObjectOfType <PlayerAimTargetIdentifier>().GetComponent <MoveToMousePosition>();
            for (int i = 0; i < selectableWeapons.Count; i++)
            {
                GameObject         geo       = Instantiate(selectableWeaponWindowPrefab, listGridParent);
                SelectableWeaponUI component = geo.GetComponent <SelectableWeaponUI>();
                component.Setup(selectableWeapons[i]);
                selectableWeaponWindows.Add(component);
            }

            if (devSettings.allowWeaponSelectionMenu == true)
            {
                window.SetActive(true);
                playerController.tickPlayer.value = false;
                moveToMousePosController.isActive = false;
            }
            else
            {
                window.SetActive(false);
            }
        }
Ejemplo n.º 2
0
        public override void Init()
        {
            LoadLevelType();

            camController            = FindObjectOfType <CamControllerGameplay>();
            poolingManager           = FindObjectOfType <PoolingManager>();
            playerController         = FindObjectOfType <PlayerSpawner>().SpawnPlayer();
            moveToMousePos           = FindObjectOfType <MoveToMousePosition>();
            bulletManager            = FindObjectOfType <Weapon_BulletManager>();
            worldInteractionsManager = FindObjectOfType <WorldInteractionsManager>();
            challenegeManager        = FindObjectOfType <ChallengeManager>();

            aimCursorManager           = FindObjectOfType <AimCursorManager>();
            uiWorldInteractionManager  = FindObjectOfType <UI_WorldInteractionManager>();
            uiLevelRestartManager      = FindObjectOfType <UI_LevelRestartManager>();
            uiReloadProgressBar        = FindObjectOfType <UI_ReloadProgressBar>();
            pauseMenuController        = FindObjectOfType <PauseMenuController>();
            weaponSelectionMenuManager = FindObjectOfType <WeaponSelectionMenuManager>();

            aiManager = FindObjectOfType <AIManager>();

            camController.Init();
            poolingManager.Init();
            moveToMousePos.Init();
            bulletManager.Init();
            playerController.Init();
            worldInteractionsManager.Init();

            aimCursorManager.Init();
            uiWorldInteractionManager.Init();
            uiLevelRestartManager.Init();
            uiReloadProgressBar.Init();
            weaponSelectionMenuManager.Init();

            aiManager.Init();
            challenegeManager.Init();
            pauseMenuController.Init();


            //Place Code Above Here
            base.Init();
        }