Browse Source

Настройка шрифтов в сцене FlowerpotPhonics

Правильное отображение шрифта Arial и настройка текта на всех языках
Unknown 6 years ago
parent
commit
bfdd03bb05

BIN
.vs/RR1st/v15/Server/sqlite3/storage.ide


BIN
.vs/RR1st/v15/Server/sqlite3/storage.ide-shm


BIN
.vs/RR1st/v15/Server/sqlite3/storage.ide-wal


+ 4 - 120
Assets/Scenes/FlowerpotPhonics.unity

@@ -311,10 +311,10 @@ MonoBehaviour:
   m_TwoBoxesSprite: {fileID: 1351005463}
   m_OnwBoxSprite: {fileID: 910430224}
   m_NextItem: {fileID: 0}
-  oneBoxTransform: {fileID: 892211608}
-  twoBoxTransform: {fileID: 420496704}
-  threeBoxTransform: {fileID: 802215813}
-  fourBoxTransform: {fileID: 1342708562}
+  oneBoxTransform: {fileID: 0}
+  twoBoxTransform: {fileID: 0}
+  threeBoxTransform: {fileID: 0}
+  fourBoxTransform: {fileID: 0}
 --- !u!61 &13069966
 BoxCollider2D:
   m_ObjectHideFlags: 0
@@ -2671,34 +2671,6 @@ SpriteRenderer:
   m_SpriteTileMode: 0
   m_WasSpriteAssigned: 1
   m_MaskInteraction: 0
---- !u!1 &420496703
-GameObject:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  serializedVersion: 5
-  m_Component:
-  - component: {fileID: 420496704}
-  m_Layer: 0
-  m_Name: TwoBoxes
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &420496704
-Transform:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  m_GameObject: {fileID: 420496703}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 449.9, y: -416.9, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 2120898379}
-  m_RootOrder: 6
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &423669454
 GameObject:
   m_ObjectHideFlags: 0
@@ -5547,34 +5519,6 @@ SpriteRenderer:
   m_SpriteTileMode: 0
   m_WasSpriteAssigned: 1
   m_MaskInteraction: 0
---- !u!1 &802215812
-GameObject:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  serializedVersion: 5
-  m_Component:
-  - component: {fileID: 802215813}
-  m_Layer: 0
-  m_Name: ThreeBoxes
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &802215813
-Transform:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  m_GameObject: {fileID: 802215812}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 508.2, y: -386.4, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 2120898379}
-  m_RootOrder: 5
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &840118312
 GameObject:
   m_ObjectHideFlags: 0
@@ -5950,34 +5894,6 @@ Transform:
   m_Father: {fileID: 1723296128}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!1 &892211607
-GameObject:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  serializedVersion: 5
-  m_Component:
-  - component: {fileID: 892211608}
-  m_Layer: 0
-  m_Name: OneBox
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &892211608
-Transform:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  m_GameObject: {fileID: 892211607}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 509, y: -416.9, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 2120898379}
-  m_RootOrder: 7
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &894332315
 GameObject:
   m_ObjectHideFlags: 0
@@ -8413,34 +8329,6 @@ SpriteRenderer:
   m_SpriteTileMode: 0
   m_WasSpriteAssigned: 1
   m_MaskInteraction: 0
---- !u!1 &1342708561
-GameObject:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  serializedVersion: 5
-  m_Component:
-  - component: {fileID: 1342708562}
-  m_Layer: 0
-  m_Name: FourBoxes
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &1342708562
-Transform:
-  m_ObjectHideFlags: 0
-  m_PrefabParentObject: {fileID: 0}
-  m_PrefabInternal: {fileID: 0}
-  m_GameObject: {fileID: 1342708561}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
-  m_LocalPosition: {x: 451.5, y: -386.4, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children: []
-  m_Father: {fileID: 2120898379}
-  m_RootOrder: 4
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1347709389
 GameObject:
   m_ObjectHideFlags: 0
@@ -14569,10 +14457,6 @@ Transform:
   - {fileID: 1649669792}
   - {fileID: 918609270}
   - {fileID: 1577925761}
-  - {fileID: 1342708562}
-  - {fileID: 802215813}
-  - {fileID: 420496704}
-  - {fileID: 892211608}
   m_Father: {fileID: 13069963}
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

+ 7 - 5
Assets/Scripts/Localizer/LocFP.cs

@@ -1,13 +1,14 @@
-#if UNITY_EDITOR
-using UnityEngine;
+using UnityEngine;
 using UnityEditor;
 using UnityEngine.UI;
 using System.Collections;
 using System;
 using System.IO;
 
+
 public class LocFP : EditorWindow
 {
+
     int language = 3;
     string[] listLanguages = { "Danish", "English", "Finnish", "French", "Nordic", "Spanish", "Swedish" };
     string imageIndex = "Resources/Resources_EN";
@@ -156,11 +157,13 @@ public class LocFP : EditorWindow
 
         //Configure Text Component
         Text textFont = itemNameLabelText.GetComponent<Text>();
+        textFont.font = Resources.GetBuiltinResource(typeof(Font), "Arial.ttf") as Font;
+        textFont.fontStyle = FontStyle.Normal;
         textFont.color = new Color(0f, 0f, 0f);
         textFont.text = nameItem;
-        textFont.fontSize = 12;
+        textFont.fontSize = 14;
         textFont.alignment = TextAnchor.MiddleCenter;
-
+     
         //return object
         return itemNameLabelCanvas;
     }
@@ -577,4 +580,3 @@ public class LocFP : EditorWindow
         }
     }
 }
-#endif