Example #1
0
        public void FindItems(string itemSuffix, string categorySuffix)
        {
            //Look into the Categories Hirearchy to see if it contains any Items
            int childCount = transform.childCount;

            for (int i = 0; i < childCount; i++)
            {
                Transform curChild = transform.GetChild(i);
                if (curChild.name.IndexOf(itemSuffix) > 0)
                {
                    EF_Customizer_Item curItem = curChild.gameObject.AddComponent <EF_Customizer_Item>();
                    m_Items.Add(curItem);
                    curItem.InitItem();
                    curItem.itemID     = i;
                    curItem.m_Category = this;
                }

                if (curChild.name.IndexOf(categorySuffix) > 0)
                {
                    EF_Customizer_Category curCategory = curChild.gameObject.AddComponent <EF_Customizer_Category>();
                    m_SubCategories.Add(curCategory);
                    curCategory.FindItems(itemSuffix, categorySuffix);
                }
            }
        }
 public void InitFaceManager()
 {
     categoryScript = GetComponent <EF_Customizer_Category>();
     if (categoryScript.m_Items.Count > 0)
     {
         startHead = categoryScript.m_Items[0];
     }
 }
 public virtual void LoadCategoryItems(EF_Customizer_Category aCategory)
 {
     //Debug.Log("Loading Items in: " + aCategory.gameObject.name);
     if (m_ItemsPanel && aCategory)
     {
         m_ItemsPanel.BuildItems(aCategory);
     }
 }
 void CreateCategory(GameObject aGO)
 {
     if (aGO)
     {
         //assign the Category Component to the gameobject
         EF_Customizer_Category curCategory = aGO.AddComponent <EF_Customizer_Category>();
         m_Categories.Add(curCategory);
         curCategory.FindItems(m_ItemSuffix, m_CategorySuffix);
     }
 }
        // Use this for initialization
        void Start()
        {
            if (!categoryScript)
            {
                categoryScript = GetComponent <EF_Customizer_Category>();
            }

            if (startHead)
            {
                categoryScript.UpdateItems(startHead.itemID);
            }
        }
        void GetTitle(EF_Customizer_Category aCategory)
        {
            if (aCategory != null)
            {
                string   rawName   = aCategory.gameObject.name;
                string[] splitName = rawName.Split('_');

                if (m_TitleText)
                {
                    m_TitleText.text = splitName[0].ToUpper();
                }
            }
        }
Example #7
0
        public void BuildItems(EF_Customizer_Category aCatagory)
        {
//            Debug.Log("Building Items");
            ClearItems();


            if (m_ItemButton && m_ContentPanel)
            {
                for (int i = 0; i < aCatagory.m_Items.Count; i++)
                {
                    EF_Item_Button curButton = (EF_Item_Button)Instantiate(m_ItemButton, m_ContentPanel);

                    //Set up the button
                    curButton.id             = i;
                    curButton.m_Image.sprite = aCatagory.m_Items[i].m_Icon;
                    curButton.m_Text.text    = aCatagory.m_Items[i].name;
                    curButton.InitButton();

                    //Set up the Click Event
                    curButton.onClickID.AddListener(aCatagory.UpdateItems);
                    currentButtons.Add(curButton);
                }
            }
        }
 void OnEnable()
 {
     targetScript = (EF_Customizer_Category)target;
     emortalSkin  = EF_Editor_Utils.GetInspectorEditorUI();
 }