Esempio n. 1
0
        public void AddCharacter(GameObject obj)
        {
            MText_Character newChar = new MText_Character();

            if (!obj)
            {
                return;
            }

            ProcessName(obj.name, out char character, out float spacing);

            newChar.character = character;
            newChar.spacing   = spacing;
            newChar.prefab    = obj;

            characters.Add(newChar);
        }
Esempio n. 2
0
        public void AddCharacter(Mesh mesh)
        {
            MText_Character newChar = new MText_Character();

            if (!mesh)
            {
                return;
            }

            ProcessName(mesh.name, out char character, out float spacing);

            newChar.character = character;
            newChar.spacing   = spacing;


            newChar.meshPrefab = mesh;

            characters.Add(newChar);
        }
Esempio n. 3
0
        void CreateCharacterList()
        {
            GUILayout.BeginHorizontal();

            EditorGUILayout.LabelField("Char -", GUILayout.MaxWidth(45));
            EditorGUILayout.LabelField("Spacing -", GUILayout.MaxWidth(65));
            EditorGUILayout.LabelField("Prefab -", GUILayout.MaxWidth(55));
            EditorGUILayout.LabelField("or Mesh Asset");

            GUILayout.EndHorizontal();

            EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

            for (int i = 0; i < myTarget.characters.Count; i++)
            {
                GUILayout.BeginHorizontal();

                //if (characters.arraySize > 0)
                if (characters.arraySize > i)
                {
                    EditorGUILayout.PropertyField(characters.GetArrayElementAtIndex(i), GUIContent.none);

                    if (GUILayout.Button("-", GUILayout.MaxWidth(30)))
                    {
                        myTarget.characters.RemoveAt(i);
                    }
                }

                GUILayout.EndHorizontal();
            }
            if (GUILayout.Button("+"))
            {
                MText_Character character = new MText_Character();
                myTarget.characters.Add(character);
                EditorUtility.SetDirty(target);
            }
        }