Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mr-kelly/KEngine
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e8a496a345d6cba93b9cb1cbce3e78af0944f4a9
Choose a base ref
...
head repository: mr-kelly/KEngine
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a57b64be0aaf4ca31ad5a7e470c404586ff0cd6d
Choose a head ref
  • 4 commits
  • 7 files changed
  • 2 contributors

Commits on Aug 27, 2016

  1. Copy the full SHA
    35ff46d View commit details

Commits on Aug 28, 2016

  1. Copy the full SHA
    473bc65 View commit details

Commits on Aug 30, 2016

  1. Copy the full SHA
    b6e8776 View commit details
  2. Copy the full SHA
    a57b64b View commit details
26 changes: 26 additions & 0 deletions KEngine.UnityProject/Assets/KEngine.Editor/Editor/BuildTools.cs
Original file line number Diff line number Diff line change
@@ -79,6 +79,32 @@ public static void MakeAssetBundleNames()

}

[MenuItem("KEngine/AssetBundle/Build All to All Platforms")]
public static void BuildAllAssetBundlesToAllPlatforms()
{
var platforms = new List<BuildTarget>()
{
BuildTarget.iOS,
BuildTarget.Android,
BuildTarget.StandaloneWindows,
// BuildTarget.StandaloneOSXIntel,
};

// Build all support platforms asset bundle
var currentBuildTarget = EditorUserBuildSettings.activeBuildTarget;
platforms.Remove(currentBuildTarget);
BuildAllAssetBundles();

foreach (var platform in platforms)
{
EditorUserBuildSettings.SwitchActiveBuildTarget(platform);
BuildAllAssetBundles();
}

// revert platform
EditorUserBuildSettings.SwitchActiveBuildTarget(currentBuildTarget);
}

[MenuItem("KEngine/AssetBundle/Build All %&b")]
public static void BuildAllAssetBundles()
{
Original file line number Diff line number Diff line change
@@ -163,15 +163,29 @@ public void ReloadAll()
_ReloadAll(false);
}
/// <summary>
/// Do reload the setting class : {{ file.ClassName }}, no exception when duplicate primary key, use custom string content
/// </summary>
public void ReloadAllWithString(string context)
{
_ReloadAll(false, context);
}
/// <summary>
/// Do reload the setting file: {{ file.ClassName }}
/// </summary>
void _ReloadAll(bool throwWhenDuplicatePrimaryKey)
void _ReloadAll(bool throwWhenDuplicatePrimaryKey, string customContent = null)
{
for (var j = 0; j < TabFilePaths.Length; j++)
{
var tabFilePath = TabFilePaths[j];
using (var tableFile = SettingModule.Get(tabFilePath, false))
TableFile tableFile;
if (customContent == null)
tableFile = SettingModule.Get(tabFilePath, false);
else
tableFile = TableFile.LoadFromString(customContent);
using (tableFile)
{
foreach (var row in tableFile)
{
Original file line number Diff line number Diff line change
@@ -150,19 +150,19 @@ public static void ExportCurrentUI()
#endif
}

static KUIWindowAsset[] GetUIWIndoeAssetsFromCurrentScene()
static UIWindowAsset[] GetUIWIndoeAssetsFromCurrentScene()
{

//var UIName = Path.GetFileNameWithoutExtension(EditorApplication.currentScene);
var windowAssets = GameObject.FindObjectsOfType<KUIWindowAsset>();
var windowAssets = GameObject.FindObjectsOfType<UIWindowAsset>();
if (windowAssets.Length <= 0)
{
#if UNITY_5
var currentScene = EditorSceneManager.GetActiveScene().path;
#else
var currentScene = EditorApplication.currentScene;
#endif
Log.Error("Not found KUIWindowAsset in scene `{0}`", currentScene);
Log.Error("Not found UIWindowAsset in scene `{0}`", currentScene);
}

return windowAssets;
@@ -192,7 +192,7 @@ public static void CreateNewUI()
}
GameObject uiObj = new GameObject(uiName);
uiObj.layer = (int)UnityLayerDef.UI;
uiObj.AddComponent<KUIWindowAsset>();
uiObj.AddComponent<UIWindowAsset>();

var uiPanel = new GameObject("Image").AddComponent<Image>();
uiPanel.transform.parent = uiObj.transform;
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
// KEngine - Toolset and framework for Unity3D
// ===================================
//
// Filename: KUIWindowAssetEditor.cs
// Filename: UIWindowAssetEditor.cs
// Date: 2015/12/03
// Author: Kelly
// Email: 23110388@qq.com
@@ -41,7 +41,7 @@ private static void HierarchyItemCB(int instanceid, Rect selectionrect)
var obj = EditorUtility.InstanceIDToObject(instanceid) as GameObject;
if (obj != null)
{
if (obj.GetComponent<KUIWindowAsset>() != null)
if (obj.GetComponent<UIWindowAsset>() != null)
{
Rect r = new Rect(selectionrect);
r.x = r.width - 30;
@@ -55,12 +55,16 @@ private static void HierarchyItemCB(int instanceid, Rect selectionrect)
}
}

[CustomEditor(typeof (KUIWindowAsset))]
public class KUIWindowAssetEditor : Editor
[CustomEditor(typeof (UIWindowAsset))]
public class UIWindowAssetEditor : Editor
{
public static System.Action<UIWindowAsset> CustomInspectorGUIAfter;
public static System.Action<UIWindowAsset> CustomInspectorGUIBefore;
public override void OnInspectorGUI()
{
if (CustomInspectorGUIBefore != null) CustomInspectorGUIBefore(target as UIWindowAsset);
EditorGUILayout.HelpBox("A UI Will be build for name: " + target.name, MessageType.Info);
base.OnInspectorGUI();
if (CustomInspectorGUIAfter != null) CustomInspectorGUIAfter(target as UIWindowAsset);
}
}
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ namespace KEngine.UI
/// Mark for build UI window
/// </summary>
[AddComponentMenu("KEngine/KUIWindowAsset")]
public class KUIWindowAsset : MonoBehaviour
public class UIWindowAsset : MonoBehaviour
{
public string StringArgument;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions KEngine.UnityProject/Assets/KEngine/AppEngine.cs
Original file line number Diff line number Diff line change
@@ -41,8 +41,8 @@ namespace KEngine
/// </summary>
public interface IAppEntry
{
IEnumerator OnBeforeInitModules();
IEnumerator OnFinishInitModules();
IEnumerator OnBeforeInit();
IEnumerator OnGameStart();
}

/// <summary>
@@ -189,12 +189,15 @@ private IEnumerator DoInit()
Log.Info("Finish Init ResourceManager");

if (AppEntry != null)
yield return StartCoroutine(AppEntry.OnBeforeInitModules());
yield return StartCoroutine(AppEntry.OnBeforeInit());


yield return StartCoroutine(DoInitModules(GameModules));
if (AppEntry != null)
yield return StartCoroutine(AppEntry.OnFinishInitModules());
{
yield return StartCoroutine(AppEntry.OnGameStart());

}

IsInited = true;
}