Пример #1
0
 private void FetchDependencies()
 {
     player             = GetNode <Player>(playerPath);
     playerUiController = GetNode <PlayerUiController>(playerUiControllerPath);
     visionController   = GetNode <VisionController>(visionControllerPath);
     mapController      = GetNode <MapController>(mapControllerPath);
 }
Пример #2
0
    private void CreatePlayerUi()
    {
        playerUiController = GameObject.Instantiate(playerUiControllerPrefab);
        RectTransform playerUiAreaTransform = playerUiArea.GetComponent <RectTransform>();

        playerUiController.GetComponent <RectTransform>().SetParent(playerUiAreaTransform);
        playerUiController.Init();
    }
Пример #3
0
    // time money other stuff new script

    void Start()
    {
        playerUI = this.gameObject.GetComponent <PlayerUiController>();
        AddByCateSupp(category, supplier, subCategory);
        AddSupplier();

        // intilise buttons
        allBtn       = transform.Find("CategoryPanel/catListPanel/allBtn").GetComponent <Button>();
        computerBtn  = transform.Find("CategoryPanel/catListPanel/ComputersBtn").GetComponent <Button>();
        hardwareBtn  = transform.Find("CategoryPanel/catListPanel/HardwareBtn").GetComponent <Button>();
        componentBtn = transform.Find("CategoryPanel/catListPanel/ComponetsBtn").GetComponent <Button>();
        gamingBtn    = transform.Find("CategoryPanel/catListPanel/gamningBtn").GetComponent <Button>();
        merchBtn     = transform.Find("CategoryPanel/catListPanel/merchBtn").GetComponent <Button>();

        desktopBtn = transform.Find("CategoryPanel/catListPanel/ComputersBtn/computerPanel/Computerbtn").GetComponent <Button>();
        LaptopBtn  = transform.Find("CategoryPanel/catListPanel/ComputersBtn/computerPanel/Laptopbtn").GetComponent <Button>();

        gpuBtn = transform.Find("CategoryPanel/catListPanel/ComponetsBtn/componentsPanel/GPUbtn").GetComponent <Button>();
        CpuBtn = transform.Find("CategoryPanel/catListPanel/ComponetsBtn/componentsPanel/CPUbtn").GetComponent <Button>();

        pcgameBtn  = transform.Find("CategoryPanel/catListPanel/gamningBtn/GamingPanel/PcGamesBtn").GetComponent <Button>();
        ConsoleBtn = transform.Find("CategoryPanel/catListPanel/gamningBtn/GamingPanel/ConsoleGameBtn").GetComponent <Button>();

        Consoles = transform.Find("CategoryPanel/catListPanel/gamningBtn/GamingPanel/ConsoleBtn").GetComponent <Button>();

        figurineBtn = transform.Find("CategoryPanel/catListPanel/merchBtn/MerchandicePanel/FigurineBtn").GetComponent <Button>();

        keyboardBtn = transform.Find("CategoryPanel/catListPanel/HardwareBtn/HardwarePanel/KeyboardBtn").GetComponent <Button>();
        MiceBtn     = transform.Find("CategoryPanel/catListPanel/HardwareBtn/HardwarePanel/MiceBtn").GetComponent <Button>();

        // When button clicked
        allBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate("all"); });
        computerBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate(ItemCategory.Computers.ToString()); });
        hardwareBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate(ItemCategory.Hardware.ToString()); });
        componentBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate(ItemCategory.Components.ToString()); });
        gamingBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate(ItemCategory.Gaming.ToString()); });
        merchBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate(ItemCategory.Merchandise.ToString()); });
        computerBtn.GetComponent <Button>().onClick.AddListener(delegate { SetCate(ItemCategory.Computers.ToString()); });

        desktopBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Computers.ToString(), ItemSubcategory.Desktop.ToString()); });
        LaptopBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Computers.ToString(), ItemSubcategory.Laptop.ToString()); });

        gpuBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Components.ToString(), ItemSubcategory.GPU.ToString()); });
        CpuBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Components.ToString(), ItemSubcategory.CPU.ToString()); });

        pcgameBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Gaming.ToString(), ItemSubcategory.PCGame.ToString()); });
        ConsoleBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Gaming.ToString(), ItemSubcategory.ConsoleGame.ToString()); });

        Consoles.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Gaming.ToString(), ItemSubcategory.Console.ToString()); });


        figurineBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Merchandise.ToString(), ItemSubcategory.figurines.ToString()); });

        keyboardBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Hardware.ToString(), ItemSubcategory.Keyboard.ToString()); });
        MiceBtn.GetComponent <Button>().onClick.AddListener(delegate { SetSubCate(ItemCategory.Hardware.ToString(), ItemSubcategory.Mouse.ToString()); });
    }
Пример #4
0
    public void Init(PlayerProfile playerProfile, string voiceName, MicProfile micProfile)
    {
        this.PlayerProfile      = playerProfile;
        this.MicProfile         = micProfile;
        this.Voice              = GetVoice(songMeta, voiceName);
        this.playerUiController = Instantiate(playerUiControllerPrefab, playerUiArea.transform);
        this.childrenInjector   = CreateChildrenInjectorWithAdditionalBindings();

        // Inject all
        childrenInjector.InjectAllComponentsInChildren(this);
        childrenInjector.InjectAllComponentsInChildren(playerUiController);

        SetDisplaySentenceIndex(0);
    }
Пример #5
0
    public void Init(PlayerProfile playerProfile, string voiceName, MicProfile micProfile)
    {
        this.PlayerProfile      = playerProfile;
        this.MicProfile         = micProfile;
        this.Voice              = GetVoice(songMeta, voiceName);
        this.playerUiController = Instantiate(playerUiControllerPrefab, playerUiArea.transform);
        this.childrenInjector   = CreateChildrenInjectorWithAdditionalBindings();

        // Inject all
        foreach (INeedInjection childThatNeedsInjection in GetComponentsInChildren <INeedInjection>())
        {
            childrenInjector.Inject(childThatNeedsInjection);
        }
        childrenInjector.Inject(playerUiController);

        // Init instances
        playerUiController.Init(PlayerProfile, MicProfile);
        PlayerScoreController.Init(Voice);
    }
Пример #6
0
        public void Init(PlayerUiController playerUiController, VisionController visionController)
        {
            this.playerUiController = playerUiController;

            GetMovementController().OnMoveStarted   += HandleActionStarted;
            GetMovementController().OnMoveCompleted += HandleActionFinished;
            healthController.OnDie += PlayerDied;

            playerInputController.Init(GetMovementController(), visionController);
            inventoryController.Init(
                GetArmorController(),
                GetWeaponController(),
                groundItemController,
                playerUiController.GetPlayerInventoryUiController()
                );
            groundItemController.Init(
                this,
                inventoryController
                );
        }
Пример #7
0
 private void CreatePlayerUi()
 {
     playerUiController = Instantiate(playerUiControllerPrefab, playerUiArea.transform);
     playerUiController.Init(PlayerProfile, MicProfile);
 }
Пример #8
0
 public PlayerUiControllerFactory(IResourcesRepository resourcesRepository, IUiElementsGenerator uiElementsGenerator)
 {
     PlayerUiController = new PlayerUiController(resourcesRepository.PlayerStats, resourcesRepository.PlayerBuffs,
                                                 resourcesRepository.GameSettings.PlayersCount, uiElementsGenerator);
 }