Пример #1
0
 public void SetToolOptionInUse(int which)
 {
     if (m_toolOptionInUse)
     {
         m_toolOptionInUse.SetIconOG();
     }
     if (m_options.Count == 0)
     {
         this.Start();
     }
     m_toolOptionInUse = m_options[which];
 }
Пример #2
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        m_options.Add(this.transform.GetChild(0).GetComponent <FoamRadialManager>());
        m_options.Add(this.transform.GetChild(1).GetComponent <FoamRadialManager>());
        m_options.Add(this.transform.GetChild(2).GetComponent <FoamRadialManager>());
        m_options.Add(this.transform.GetChild(3).GetComponent <FoamRadialManager>());
        m_optionCenter = this.transform.GetChild(4).GetComponent <FoamRadialCenterManager>();

        if (IsToolMenu)
        {
            m_toolOptionInUse = m_options[m_defaultOption];
        }
    }
Пример #3
0
    // will only be called if region changes
    public void HighlightSprite(int which)
    {
        Debug.Log("--------region changed");
        if (m_currentSelectedIcon)
        {
            m_currentSelectedIcon.DeHighlightIcon();
        }

        if (which == -1)
        {
            m_optionCenter.DeHighlightCenter();
            return;
        }

        m_currentSelectedIcon = m_options[which];
        m_currentSelectedIcon.HightlightIcon();
    }
Пример #4
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        //The target variable is the selected MyBehaviour.
        FoamRadialManager frm = (FoamRadialManager)target;

        //Create a toggle for the bool variable;
        frm.IsToolOption = EditorGUILayout.Toggle("Is Too lOption", frm.IsToolOption);

        //Create an input field for the int only if the bool field is true.
        if (frm.IsToolOption)
        {
            //frm.m_inUseSprite = (Sprite)EditorGUILayout.ObjectField("InUseSprite", frm.m_inUseSprite, typeof(Sprite), allowSceneObjects: true);
            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("In Use State Icon");
            frm.m_inUseSprite = (Sprite)EditorGUILayout.ObjectField(frm.m_inUseSprite, typeof(Sprite), allowSceneObjects: true);
            EditorGUILayout.EndHorizontal();
            frm.m_iconChild = (SpriteRenderer)EditorGUILayout.ObjectField("Icon Renderer", frm.m_iconChild, typeof(SpriteRenderer), allowSceneObjects: true);
        }
    }