public BodyPart ParentBodyPart;         // can be null with root

        public override void SetUp(CharacterCustomization incharacterCustomization, BodyPart Body_Part, string path)
        {
            base.SetUp(incharacterCustomization, Body_Part, path);
            RelatedBodyPart = Body_Part;
            List <string> itemOptions = null;

            // Make a list of all available options which can then be passed to the dropdown box
            foreach (var Keyv in incharacterCustomization.ParentDictionary)
            {
                if (Keyv.Value.Contains(Body_Part))
                {
                    ParentBodyPart = Keyv.Key;
                }
            }

            CurrentBodyPart       = Body_Part;
            ToChooseFromBodyParts = Body_Part.OptionalReplacementOrgan;
            itemOptions           = Body_Part.OptionalReplacementOrgan.Select(gameObject => gameObject.name).ToList();


            itemOptions.Sort();

            // Ensure "None" is at the top of the option lists
            itemOptions.Insert(0, Body_Part.name);
            Dropdown.AddOptions(itemOptions);
            Dropdown.onValueChanged.AddListener(ItemChange);
        }
Esempio n. 2
0
        public override void SetUp(CharacterCustomization incharacterCustomization, BodyPart Body_Part, string path)
        {
            base.SetUp(incharacterCustomization, Body_Part, path);
            // Make a list of all available options which can then be passed to the dropdown box
            var itemOptions = OptionalSprites.Select(pcd => pcd.DisplayName).ToList();

            itemOptions.Sort();

            // Ensure "None" is at the top of the option lists
            itemOptions.Insert(0, "None");
            Dropdown.AddOptions(itemOptions);
            Dropdown.onValueChanged.AddListener(ItemChange);
        }
Esempio n. 3
0
 /// <summary>
 /// Toggle isReady and update the UI
 /// </summary>
 public void OnReadyButton()
 {
     _ = SoundManager.Play(SingletonSOSounds.Instance.Click01);
     CharacterCreator.CharacterCustomization customizerScript = characterCustomization.GetComponentInChildren <CharacterCreator.CharacterCustomization>();
     customizerScript.GetSavedCharacters();
     if (customizerScript.PlayerCharacters.Count == 0)
     {
         warnText.SetActive(true);
         return;
     }
     else
     {
         customizerScript.ValidateCurrentCharacter();
     }
     SetReady(!isReady);
     TryShowAdminPanel();
 }
Esempio n. 4
0
        public override void SetUp(CharacterCustomization incharacterCustomization, BodyPart Body_Part, string path)
        {
            base.SetUp(incharacterCustomization, Body_Part, path);
            thisRelatedBodyPart = (IBodyPartDropDownOrgans)Body_Part;
            List <string> itemOptions = null;

            // Make a list of all available options which can then be passed to the dropdown box

            ToChooseFromBodyParts = RelatedBodyPart.OptionalOrgans;
            itemOptions           = RelatedBodyPart.OptionalOrgans.Select(gameObject => gameObject.name).ToList();


            itemOptions.Sort();

            Dropdown.AddOptions(itemOptions);
            Dropdown.onValueChanged += ItemChange;
        }
Esempio n. 5
0
        public void Setup(CustomisationGroup Customisations, CharacterCustomization incharacterCustomization, SpriteOrder _SpriteOrder)
        {
            thisCustomisations     = Customisations;
            characterCustomization = incharacterCustomization;
            HeadName.text          = Customisations.ThisType.ToString();
            spriteOrder            = _SpriteOrder;
            spriteHandlerNorder.SetSpriteOrder(spriteOrder);
            ThisType = Customisations.ThisType;

            // Make a list of all available options which can then be passed to the dropdown box
            var itemOptions = Customisations.PlayerCustomisations.Select(pcd => pcd.Name).ToList();

            itemOptions.Sort();

            // Ensure "None" is at the top of the option lists
            itemOptions.Insert(0, "None");
            Dropdown.AddOptions(itemOptions);

            RelatedSpriteRenderer.gameObject.transform.SetParent(incharacterCustomization.SpriteContainer.transform);
            RelatedSpriteRenderer.gameObject.transform.localPosition = Vector3.zero;
            Dropdown.onValueChanged.AddListener(ItemChange);
        }
Esempio n. 6
0
        public void SetUp(CharacterCustomization incharacterCustomization, IBodyPartDropDownOrgans Body_Part, string path)
        {
            //base.SetUp(incharacterCustomization, Body_Part, path);
            characterCustomization = incharacterCustomization;
            //Text.text = Body_Part.name;
            thisRelatedBodyPart = Body_Part;
            List <string> itemOptions = null;

            // Make a list of all available options which can then be passed to the dropdown box

            ToChooseFromBodyParts = thisRelatedBodyPart.OptionalOrgans;
            itemOptions           = thisRelatedBodyPart.OptionalOrgans.Select(gameObject => gameObject.name).ToList();


            itemOptions.Sort();
            foreach (var I in itemOptions)
            {
                PreviousOptions.Add(false);
            }

            Dropdown.AddOptions(itemOptions);
            Dropdown.onValueChanged += ItemChange;
        }
 public virtual void SetUp(CharacterCustomization incharacterCustomization, BodyPart Body_Part, string path)
 {
     RelatedBodyPart        = Body_Part;
     characterCustomization = incharacterCustomization;
     Text.text = Body_Part.name;
 }