Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaser324 committed Jan 11, 2017
2 parents 01b3d26 + 1ccbe50 commit c27e651
Show file tree
Hide file tree
Showing 118 changed files with 8,790 additions and 1,150 deletions.
32 changes: 32 additions & 0 deletions BuildConstants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// This file is auto-generated. Do not modify or move this file.

public static class BuildConstants
{
public enum ReleaseType
{
None,
}

public enum Platform
{
None,
}

public enum Architecture
{
None,
}

public enum Distribution
{
None,
}

public static readonly System.DateTime buildDate = System.DateTime.Now;
public const string version = "";
public const ReleaseType releaseType = ReleaseType.None;
public const Platform platform = Platform.None;
public const Architecture architecture = Architecture.None;
public const Distribution distribution = Distribution.None;
}

4 changes: 2 additions & 2 deletions Editor/Build/Generator.cs.meta → BuildConstants.cs.meta

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

85 changes: 0 additions & 85 deletions Editor/AssetBundles/BuildAssetBundles.cs

This file was deleted.

82 changes: 0 additions & 82 deletions Editor/AssetBundles/BuildAssetBundlesSettings.cs

This file was deleted.

104 changes: 80 additions & 24 deletions Editor/Build/Action/BuildAction.cs
Original file line number Diff line number Diff line change
@@ -1,49 +1,105 @@
using System;
using UnityEditor;
using UnityEngine;
using UnityEditor;

namespace UnityBuild
namespace SuperSystems.UnityBuild
{

public abstract class BuildAction : IComparable<BuildAction>
[System.Serializable]
public class BuildAction : ScriptableObject // This really should be an abstract class but needs to be concrete to work with Unity serialization.
{
public enum ActionType
{
SingleRun,
PerPlatform
}

public ActionType actionType = ActionType.PerPlatform;
public string actionName = string.Empty;
public string note = string.Empty;
public BuildFilter filter = new BuildFilter();

/// <summary>
/// Build action.
/// This will be exectued once before/after all players are built.
/// </summary>
public virtual void Execute()
{
}

/// <summary>
/// Platform-specific build action.
/// This will be executed before/after each individual player is built.
/// </summary>
/// <param name="platform"></param>
public virtual void Execute(BuildPlatform platform)
public virtual void PerBuildExecute(
BuildReleaseType releaseType,
BuildPlatform platform,
BuildArchitecture architecture,
BuildDistribution distribution,
System.DateTime buildTime, ref BuildOptions options, string configKey, string buildPath)
{
}

/// <summary>
/// Priority of this build action. Lower values execute earlier.
/// </summary>
public virtual int priority
public void Draw(SerializedObject obj)
{
get
DrawProperties(obj);

System.Type myType = this.GetType();
bool actionTypeSelectable = false;
if (typeof(IPreBuildAction).IsAssignableFrom(myType) &&
typeof(IPreBuildPerPlatformAction).IsAssignableFrom(myType))
{
return 100;
actionTypeSelectable = true;
}
else if (typeof(IPostBuildAction).IsAssignableFrom(myType) &&
typeof(IPostBuildPerPlatformAction).IsAssignableFrom(myType))
{
actionTypeSelectable = true;
}
else if (typeof(IPreBuildAction).IsAssignableFrom(myType) ||
typeof(IPostBuildAction).IsAssignableFrom(myType))
{
actionType = ActionType.SingleRun;
}
else if (typeof(IPreBuildPerPlatformAction).IsAssignableFrom(myType) ||
typeof(IPostBuildPerPlatformAction).IsAssignableFrom(myType))
{
actionType = ActionType.PerPlatform;
}
}

#region IComparable
if (actionTypeSelectable)
{
actionType = (ActionType)EditorGUILayout.EnumPopup("Action Type", actionType);
}
EditorGUILayout.PropertyField(obj.FindProperty("note"));
EditorGUILayout.PropertyField(obj.FindProperty("filter"), GUILayout.Height(0));
obj.ApplyModifiedProperties();
}

public int CompareTo(BuildAction other)
protected virtual void DrawProperties(SerializedObject obj)
{
if (other == null)
return 1;
else
return priority.CompareTo(other.priority);
}
SerializedProperty prop = obj.GetIterator();
bool done = false;

#endregion
while (!done && prop != null)
{
if (prop.name == "actionName" ||
prop.name == "actionType" ||
prop.name == "note" ||
prop.name == "filter")
{
// Already drawn these. Go to next, don't enter into object.
done = !prop.NextVisible(false);
}
else if (prop.name == "Base")
{
// Valid property we want to enter, but don't want to draw the parent node.
done = !prop.NextVisible(true);
}
else
{
EditorGUILayout.PropertyField(prop);
done = !prop.NextVisible(true);
}
}
}
}

}
}
11 changes: 11 additions & 0 deletions Editor/Build/Action/BuildActionList.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

namespace SuperSystems.UnityBuild
{

[System.Serializable]
public class BuildActionList
{
public BuildAction[] buildActions = new BuildAction[] { };
}

}

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

Loading

0 comments on commit c27e651

Please sign in to comment.