Skip to content

Commit 0605a33

Browse files
committed
Merge pull request #6 from mr-kelly/master
目录规范化改名
2 parents c26a528 + 1f88e11 commit 0605a33

File tree

18 files changed

+91
-142
lines changed

18 files changed

+91
-142
lines changed

Assets/CosmosEngine/Editor/CosmosEngineEditor/CAutoResourceBuilder.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public static void ProductExport(AutoBuildBase export)
3737
if (ext.StartsWith("dir:")) // 目錄下的所有文件,包括子文件夾
3838
{
3939
string newExt = ext.Replace("dir:", "");
40-
itemArray = Directory.GetFiles("Assets/Product/" + export.GetDirectory(), newExt, SearchOption.AllDirectories);
40+
itemArray = Directory.GetFiles("Assets/_ResourcesBuild_/" + export.GetDirectory(), newExt, SearchOption.AllDirectories);
4141
}
4242
else if (ext == "dir")
43-
itemArray = Directory.GetDirectories("Assets/Product/" + export.GetDirectory());
43+
itemArray = Directory.GetDirectories("Assets/_ResourcesBuild_/" + export.GetDirectory());
4444
else if (ext == "")
4545
itemArray = new string[0];
4646
else
47-
itemArray = Directory.GetFiles("Assets/Product/" + export.GetDirectory(), export.GetExtention()); // 不包括子文件夾
47+
itemArray = Directory.GetFiles("Assets/_ResourcesBuild_/" + export.GetDirectory(), export.GetExtention()); // 不包括子文件夾
4848

4949
export.BeginExport();
5050
foreach (string item in itemArray)

Assets/CosmosEngine/Editor/CosmosEngineEditor/CBuild_UI.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ void CreateTempPrefab()
8888
{
8989
TempPanelObject = (GameObject)GameObject.Instantiate(WindowObject);
9090

91-
if (WindowObject.GetComponent<UIPanel>() == null)
92-
{
93-
// 读取UIPanel的depth, 遍历所有UI控件,将其depth加上UIPanel Depth, 以此设置层级关系
94-
// 如PanelRoot Depth填10, 子控件填0,1,2 打包后,子控件层级为 10 << 5 | 1 = 320, 321, 322
95-
foreach (UIWidget uiWidget in TempPanelObject.GetComponentsInChildren<UIWidget>(true))
96-
{
97-
uiWidget.depth = (PanelRoot.depth + 15) << 5 | (uiWidget.depth + 15); // + 15是为了杜绝负数!不要填-15以上的
98-
}
99-
}
91+
//if (WindowObject.GetComponent<UIPanel>() == null)
92+
//{
93+
// // 读取UIPanel的depth, 遍历所有UI控件,将其depth加上UIPanel Depth, 以此设置层级关系
94+
// // 如PanelRoot Depth填10, 子控件填0,1,2 打包后,子控件层级为 10 << 5 | 1 = 320, 321, 322
95+
// foreach (UIWidget uiWidget in TempPanelObject.GetComponentsInChildren<UIWidget>(true))
96+
// {
97+
// uiWidget.depth = (PanelRoot.depth + 15) << 5 | (uiWidget.depth + 15); // + 15是为了杜绝负数!不要填-15以上的
98+
// }
99+
//}
100100

101101
foreach (UIButton go in TempPanelObject.GetComponentsInChildren<UIButton>(true))
102102
{
@@ -186,7 +186,10 @@ public static void CreateNewUI()
186186

187187
UIRoot uiRoot = uiRootObj.AddComponent<UIRoot>();
188188
uiRoot.scalingStyle = UIRoot.Scaling.ConstrainedOnMobiles;
189-
uiRoot.manualHeight = 960;
189+
uiRoot.manualHeight = 1920;
190+
uiRoot.manualWidth = 1080;
191+
uiRoot.fitHeight = true;
192+
uiRoot.fitWidth = true;
190193

191194
GameObject cameraObj = new GameObject("Camera");
192195
cameraObj.layer = (int)CLayerDef.UI;
@@ -236,7 +239,7 @@ public static void ExportUIMenu()
236239
}
237240

238241
/// <summary>
239-
/// Buidl All UI Scene under Assets/Products/ folder
242+
/// Buidl All UI Scene under Assets/_ResourcesBuild_s/ folder
240243
/// </summary>
241244
[MenuItem("CosmosEngine/UI/Export All UI")]
242245
public static void ExportAllUI()

Assets/CosmosEngine/Editor/CosmosEngineEditor/CTestTools.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/CosmosEngine/Scripts/Base/CBehaviour.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ public class CBehaviour : MonoBehaviour
2020
public GameObject _GameObject;
2121
protected bool IsDeleted = false;
2222

23-
static bool IsApplicationQuited = false; // 全局标记, 程序是否退出状态
23+
static bool _IsApplicationQuited = false; // 全局标记, 程序是否退出状态
24+
public static bool IsApplicationQuited {get { return _IsApplicationQuited; }}
25+
2426
public static System.Action ApplicationQuitEvent;
2527

2628
private float _TimeScale = 1f; // TODO: In Actor, Bullet,....
@@ -71,10 +73,10 @@ protected virtual void OnDestroy()
7173

7274
void OnApplicationQuit()
7375
{
74-
if (!IsApplicationQuited)
76+
if (!_IsApplicationQuited)
7577
CBase.Log("OnApplicationQuit!");
7678

77-
IsApplicationQuited = true;
79+
_IsApplicationQuited = true;
7880

7981
if (ApplicationQuitEvent != null)
8082
ApplicationQuitEvent();

Assets/CosmosEngine/Scripts/BaseModules/UI/CUIController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void DestroyGameObjectChildren(GameObject go)
125125
/// 模仿 NGUISelectionTool的同名方法,将位置旋转缩放清零
126126
/// </summary>
127127
/// <param name="t"></param>
128-
public void ClearLocalTransform(Transform t)
128+
public void ResetLocalTransform(Transform t)
129129
{
130130
t.localPosition = Vector3.zero;
131131
t.localRotation = Quaternion.identity;
@@ -160,7 +160,7 @@ void _ResizeUIWidgetContainerGameObjects(UIWidgetContainer uiGrid, int resizeCou
160160
{
161161
newTemplate = Instantiate(templateForNew) as GameObject;
162162
newTemplate.transform.parent = uiGrid.transform;
163-
ClearLocalTransform(newTemplate.transform);
163+
ResetLocalTransform(newTemplate.transform);
164164

165165
//gameObjList.Add(newTemplate);
166166
}

Assets/CosmosEngine/Scripts/Utils/CTabReader.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/CosmosEngine/Scripts/Utils/CTool.cs

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static public uint LowInt(ulong l)
196196

197197
public static string HumanizeTimeString(int seconds)
198198
{
199-
TimeSpan ts = new TimeSpan(0, 0, seconds);
199+
TimeSpan ts = TimeSpan.FromSeconds(seconds);
200200
string timeStr = string.Format("{0}{1}{2}{3}",
201201
ts.Days == 0 ? "" : ts.Days + "天",
202202
ts.Hours == 0 ? "" : ts.Hours + "小时",
@@ -221,16 +221,26 @@ public static DateTime GetDateTime(double unixTimeStamp)
221221
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
222222
return origin.AddSeconds(unixTimeStamp);
223223
}
224+
/// <summary>
225+
/// Unix時間總毫秒數
226+
/// </summary>
227+
/// <returns></returns>
228+
public static double GetUTCMilliseconds()
229+
{
230+
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
231+
TimeSpan diff = DateTime.UtcNow - origin;
232+
return diff.TotalMilliseconds;
233+
}
224234

225235
/// <summary>
226236
/// Unix時間總秒數
227237
/// </summary>
228238
/// <returns></returns>
229-
public static uint GetUnixSeconds()
239+
public static double GetUTCSeconds()
230240
{
231241
DateTime origin = new DateTime(1970, 1, 1, 0, 0, 0, 0);
232-
TimeSpan diff = DateTime.Now - origin;
233-
return (uint)diff.TotalSeconds;
242+
TimeSpan diff = DateTime.UtcNow - origin;
243+
return diff.TotalSeconds;
234244
}
235245

236246
public static UInt64 GetTimeEx()
@@ -332,6 +342,22 @@ public static string[] Match(string find, string pattern)
332342
return result;
333343
}
334344

345+
/// <summary>
346+
/// Recursively set the game object's layer.
347+
/// </summary>
348+
static public void SetLayer(GameObject go, int layer)
349+
{
350+
go.layer = layer;
351+
352+
var t = go.transform;
353+
354+
for (int i = 0, imax = t.childCount; i < imax; ++i)
355+
{
356+
var child = t.GetChild(i);
357+
SetLayer(child.gameObject, layer);
358+
}
359+
}
360+
335361
public static void SetChild(GameObject child, GameObject parent)
336362
{
337363
SetChild(child.transform, parent.transform);

Assets/CosmosEngine/Scripts/Utils/ICTabReadble.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/CBuild_Audio.cs.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor/CosmosEngineEditor.meta

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)