public void Click()
 {
     HowToPlayHolder.Hide();
     MainMenuHolder.Hide();
     OptionsHolder.Hide();
     CreditsHolder.Show();
 }
Esempio n. 2
0
        public static List <string> GetAllFiles()
        {
            OptionsHolder optionsHolder = ServiceLocator.Instance.GetService <OptionsHolder>();
            List <string> files         = new List <string>();

            foreach (string path in optionsHolder.PathsToSearch)
            {
                string serach   = "*.mp3";
                var    filesRaw = Directory.GetFiles(path, serach, SearchOption.AllDirectories);
                foreach (string filename in filesRaw)
                {
                    if (string.IsNullOrWhiteSpace(filename))
                    {
                        continue;
                    }

                    files.Add(filename);
                }

                serach   = "*.wav";
                filesRaw = Directory.GetFiles(path, serach, SearchOption.AllDirectories);
                foreach (string filename in filesRaw)
                {
                    if (string.IsNullOrWhiteSpace(filename))
                    {
                        continue;
                    }

                    files.Add(filename);
                }
            }

            return(files);
        }
 private void ActivateNextCharacter(OptionsHolder optionsHolder)
 {
     if (optionsHolder.assetList.value < optionsHolder.assetList.options.Count)
     {
         optionsHolder.assetList.value++;
         ActivateCharacter(optionsHolder);
     }
 }
 private void ActivatePreviousCharacter(OptionsHolder optionsHolder)
 {
     if (optionsHolder.assetList.value > 0)
     {
         optionsHolder.assetList.value--;
         ActivateCharacter(optionsHolder);
     }
 }
 public void PreviousMaterial(int meshIndex, int objectIndex, OptionsHolder optionsHolder)
 {
     if (optionsHolder.assetList.value > 0)
     {
         optionsHolder.assetList.value--;
         ChangeMaterial(meshIndex, objectIndex, optionsHolder);
     }
 }
 //-----------------------------------------------------------------
 public void NextMaterial(int meshIndex, int objectIndex, OptionsHolder optionsHolder)
 {
     if (optionsHolder.assetList.value < optionsHolder.assetList.options.Count - 1)
     {
         optionsHolder.assetList.value++;
         ChangeMaterial(meshIndex, objectIndex, optionsHolder);
     }
 }
 public void PreviousModel(int elementIndex, OptionsHolder optionsDropdown, List <Transform> materialOptions, Transform assetHolder)
 {
     if (optionsDropdown.assetList.value > 0)
     {
         optionsDropdown.assetList.value--;
         ActivateModel(elementIndex, optionsDropdown, materialOptions, assetHolder);
     }
 }
 public void NextModel(int elementIndex, OptionsHolder optionsDropdown, List <Transform> materialOptions, Transform assetHolder)
 {
     if (optionsDropdown.assetList.value < optionsDropdown.assetList.options.Count)
     {
         optionsDropdown.assetList.value++;
         ActivateModel(elementIndex, optionsDropdown, materialOptions, assetHolder);
     }
 }
 public void PreviousPlayAnimation(OptionsHolder optionsHolder)
 {
     if (optionsHolder.assetList.value > 0)
     {
         optionsHolder.assetList.value--;
         PlayAnimation(optionsHolder);
     }
 }
 public void NextPlayAnimation(OptionsHolder optionsHolder)
 {
     if (optionsHolder.assetList.value < optionsHolder.assetList.options.Count)
     {
         optionsHolder.assetList.value++;
         PlayAnimation(optionsHolder);
     }
 }
Esempio n. 11
0
 //switch references for all options
 public void switchDifficulty(OptionsHolder other)
 {
     Debug.Log("switchDifficulty");
     this._generalOP     = other._generalOP;
     this._asteroidOP    = other._asteroidOP;
     this._sunOP         = other._sunOP;
     this._patternsOP    = other._patternsOP;
     this._patternsPhase = other._patternsPhase;
 }
    public void Click()
    {
        if (PauseMenu.self)
        {
            PauseMenu.self.isInSubMenu = true;
        }

        HowToPlayHolder.Hide();
        CreditsHolder.Hide();
        MainMenuHolder.Hide();
        OptionsHolder.Show();
    }
Esempio n. 13
0
        public PartialViewResult DeleteClient(string options, int page, long id)
        {
            ClientRepo.DeleteClient(id);
            OptionsHolder <ClientModel> holder = OptionsHolder <ClientModel> .GetHolder(options);

            PageSortOptions pso = new PageSortOptions()
            {
                Column    = holder.Sort.Column,
                Direction = holder.Sort.Direction,
                Page      = page
            };

            return(PartialView("SearchResultsWithPaging", GetClientsList(holder.Filter, pso)));
        }
    public void ActivateModel(int elementIndex, OptionsHolder optionsHolder, List <Transform> materialOptions, Transform assetHolder)
    {
        //If we used presets our character is currently inactive therefore we need to switch it on
        if (characters[characterCounter].gameObject.activeInHierarchy == false)
        {
            if (presets != null)
            {
                presets.DeactivatePreset();
            }

            characters[characterCounter].gameObject.SetActive(true);
        }

        currentCharacterItems.itemsConfiguration[elementIndex].ActivateModel(optionsHolder.assetList.value);
        optionsHolder.CheckButtons();

        //Clearing material options
        foreach (var materialOption in materialOptions)
        {
            if (materialOption != null)
            {
                Destroy(materialOption.gameObject);
            }
        }

        //Generating material options for given item
        if (currentCharacterItems.itemsConfiguration[elementIndex].items[optionsHolder.assetList.value].materials != null)
        {
            for (int i = 0; i < currentCharacterItems.itemsConfiguration[elementIndex].items[optionsHolder.assetList.value].materials.Count; i++)
            {
                var materialIndex = i;
                var instantiatedMaterialOption = Instantiate(optionHodler, assetHolder);
                materialOptions.Add(instantiatedMaterialOption.transform);

                var optionsNames = new List <string>();

                foreach (var option in currentCharacterItems.itemsConfiguration[elementIndex].items[optionsHolder.assetList.value].materials[i].aviableMaterials)
                {
                    optionsNames.Add(option.name);
                }

                instantiatedMaterialOption.assetList.AddOptions(optionsNames);
                instantiatedMaterialOption.assetList.value = currentCharacterItems.itemsConfiguration[elementIndex].items[optionsHolder.assetList.value].materials[materialIndex].GetCounter;
                instantiatedMaterialOption.assetList.onValueChanged.AddListener(delegate { ChangeMaterial(elementIndex, materialIndex, instantiatedMaterialOption); });
                instantiatedMaterialOption.nextButton.onClick.AddListener(delegate { NextMaterial(elementIndex, materialIndex, instantiatedMaterialOption); });
                instantiatedMaterialOption.previousButton.onClick.AddListener(delegate { PreviousMaterial(elementIndex, materialIndex, instantiatedMaterialOption); });
                ChangeMaterial(elementIndex, materialIndex, instantiatedMaterialOption);
            }
        }
    }
Esempio n. 15
0
        public PartialViewResult DeleteUser(string options, int page, Guid id)
        {
            ProfileRepo.DeleteUser(id);
            OptionsHolder <UserProfileModel> holder = OptionsHolder <UserProfileModel> .GetHolder(options.Replace("\"\"", "null"));

            PageSortOptions pso = new PageSortOptions()
            {
                Column    = holder.Sort.Column,
                Direction = holder.Sort.Direction,
                Page      = page
            };

            return(PartialView("SearchResultsWithPaging", GetUsersList(holder.Filter, pso)));
        }
    public void ChangeMaterial(int meshIndex, int objectIndex, OptionsHolder optionsHodler)
    {
        if (characters[characterCounter].gameObject.activeInHierarchy == false)
        {
            if (presets != null)
            {
                presets.DeactivatePreset();
            }

            characters[characterCounter].gameObject.SetActive(true);
        }

        optionsHodler.CheckButtons();
        currentCharacterItems.itemsConfiguration[meshIndex].ChangeMaterial(objectIndex, optionsHodler.assetList.value);
    }
    private void ActivateCharacter(OptionsHolder optionsHolder)
    {
        characters[characterCounter].gameObject.SetActive(false);
        if (presets != null)
        {
            presets.DeactivatePreset();
        }

        characters[optionsHolder.assetList.value].gameObject.SetActive(true);

        presets          = characters[optionsHolder.assetList.value].gameObject.GetComponent <PresetCharacter>();
        characterCounter = optionsHolder.assetList.value;

        GeneratePresetUI();
        ActivatePlayerCharacter();

        optionsHolder.CheckButtons();
    }
    //-----------------------------------------------------------------
    private void GeneratePresetUI()
    {
        if (presetsHolder != null)
        {
            Destroy(presetsHolder.gameObject);
        }

        if (presets != null)
        {
            var assetHolderInstance = Instantiate(assetHolder, rightHolder);

            presetsHolder = assetHolderInstance;

            var holderName = assetHolderInstance.GetComponentInChildren <Text>();

            if (holderName != null)
            {
                holderName.text = "Presets";
            }

            var optionsInstance = Instantiate(optionHodler, assetHolderInstance);

            var presetsNames = new List <string>();
            presetsNames.Add("None");

            foreach (var preset in presets.characters)
            {
                if (preset != null)
                {
                    presetsNames.Add(preset.name);
                }
            }

            optionsInstance.assetList.AddOptions(presetsNames);
            optionsInstance.assetList.value = 0;
            presetOptions = optionsInstance;
            presetOptions.CheckButtons();

            optionsInstance.assetList.onValueChanged.AddListener(delegate { ActivatePreset(); });
            optionsInstance.nextButton.onClick.AddListener(delegate { ActivateNextPreset(); });
            optionsInstance.previousButton.onClick.AddListener(delegate { ActivatePreviousPreset(); });
        }
    }
Esempio n. 19
0
 public void getCurrentOptions(out OptionsHolder output)
 {
     output = currentOptions;
 }
 public void PlayAnimation(OptionsHolder optionsHolder)
 {
     currentCharacterAnimation.Play(optionsHolder.assetList.options[optionsHolder.assetList.value].text);
     optionsHolder.CheckButtons();
 }