-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
Assets/Plugins/Editor/JetBrains/ | ||
[Ll]ibrary/ | ||
[Tt]emp/ | ||
[Oo]bj/ | ||
[Bb]uild/ | ||
[Bb]uilds/ | ||
[Ll]ogs/ | ||
.idea/ | ||
Assets/AssetStoreTools* | ||
|
||
# Visual Studio cache directory | ||
.vs/ | ||
|
||
# Autogenerated VS/MD/Consulo solution and project files | ||
ExportedObj/ | ||
.consulo/ | ||
*.csproj | ||
*.unityproj | ||
*.sln | ||
*.suo | ||
*.tmp | ||
*.user | ||
*.userprefs | ||
*.pidb | ||
*.booproj | ||
*.svd | ||
*.pdb | ||
*.opendb | ||
*.VC.db | ||
|
||
# Unity3D generated meta files | ||
*.pidb.meta | ||
*.pdb.meta | ||
|
||
# Unity3D Generated File On Crash Reports | ||
sysinfo.txt | ||
|
||
# Builds | ||
*.apk | ||
*.unitypackage | ||
|
||
# Crashlytics generated file | ||
Assets/StreamingAssets/crashlytics-build.properties | ||
|
||
UpgradeLog.htm |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using UnityEditor; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using UnityEngine; | ||
|
||
public class BuildClass | ||
{ | ||
private static EditorBuildSettingsScene[] GetEditorBuildSettingsScenes() | ||
{ | ||
// ビルド対象シーンリスト | ||
List<EditorBuildSettingsScene> allScene = new List<EditorBuildSettingsScene>(); | ||
foreach (EditorBuildSettingsScene scene in EditorBuildSettings.scenes) | ||
{ | ||
if (scene.enabled) | ||
{ | ||
allScene.Add(scene); | ||
} | ||
} | ||
return allScene.ToArray(); | ||
} | ||
|
||
private static string DoBashCommand(string cmd) | ||
{ | ||
var p = new Process(); | ||
p.StartInfo.FileName = "/bin/bash"; | ||
p.StartInfo.Arguments = "-c \" " + cmd + " \""; | ||
p.StartInfo.UseShellExecute = false; | ||
p.StartInfo.RedirectStandardOutput = true; | ||
p.Start(); | ||
|
||
var output = p.StandardOutput.ReadToEnd(); | ||
p.WaitForExit(); | ||
p.Close(); | ||
|
||
return output; | ||
} | ||
|
||
private static string GetProjectRoot() | ||
{ | ||
var path = Application.dataPath; | ||
var s = path.Length - 7; | ||
var root = path.Remove(s); | ||
return root; | ||
} | ||
|
||
[MenuItem("UniP2P/Build and Double Run")] | ||
public static void Build() | ||
{ | ||
// 実行 | ||
#if UNITY_EDITOR_WIN | ||
var filename = GetProjectRoot() + "/Build/" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + "/" + | ||
Application.productName + ".exe"; | ||
BuildPipeline.BuildPlayer(GetEditorBuildSettingsScenes(), filename, BuildTarget.StandaloneWindows64, BuildOptions.None); | ||
Process.Start(filename); | ||
Process.Start(filename); | ||
#elif UNITY_EDITOR_MAC | ||
var filename = GetProjectRoot() + "/Build/" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + "/" + | ||
Application.productName + ".app"; | ||
BuildPipeline.BuildPlayer(GetEditorBuildSettingsScenes(), filename, BuildTarget.StandaloneOSX, BuildOptions.None); | ||
DoBashCommand("open -n " + filename); | ||
DoBashCommand("open -n " + filename); | ||
#endif | ||
} | ||
|
||
[MenuItem("UniP2P/Build and Run")] | ||
public static void SingleBuild() | ||
{ | ||
#if UNITY_EDITOR_WIN | ||
var filename = GetProjectRoot() + "/Build/" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + "/" + | ||
Application.productName + ".exe"; | ||
BuildPipeline.BuildPlayer(GetEditorBuildSettingsScenes(), filename, BuildTarget.StandaloneWindows64, BuildOptions.None); | ||
Process.Start(filename); | ||
#elif UNITY_EDITOR_MAC | ||
var filename = GetProjectRoot() + "/Build/" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm") + "/" + | ||
Application.productName + ".app"; | ||
BuildPipeline.BuildPlayer(GetEditorBuildSettingsScenes(), filename, BuildTarget.StandaloneOSX, BuildOptions.None); | ||
DoBashCommand("open -n " + filename); | ||
#endif | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using System; | ||
|
||
namespace MessagePack | ||
{ | ||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = true)] | ||
public class MessagePackObjectAttribute : Attribute | ||
{ | ||
public bool KeyAsPropertyName { get; private set; } | ||
|
||
public MessagePackObjectAttribute(bool keyAsPropertyName = false) | ||
{ | ||
this.KeyAsPropertyName = keyAsPropertyName; | ||
} | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] | ||
public class KeyAttribute : Attribute | ||
{ | ||
public int? IntKey { get; private set; } | ||
public string StringKey { get; private set; } | ||
|
||
public KeyAttribute(int x) | ||
{ | ||
this.IntKey = x; | ||
} | ||
|
||
public KeyAttribute(string x) | ||
{ | ||
this.StringKey = x; | ||
} | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] | ||
public class IgnoreMemberAttribute : Attribute | ||
{ | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class, AllowMultiple = true, Inherited = false)] | ||
public class UnionAttribute : Attribute | ||
{ | ||
public int Key { get; private set; } | ||
public Type SubType { get; private set; } | ||
|
||
public UnionAttribute(int key, Type subType) | ||
{ | ||
this.Key = key; | ||
this.SubType = subType; | ||
} | ||
} | ||
|
||
[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false, Inherited = true)] | ||
public class SerializationConstructorAttribute : Attribute | ||
{ | ||
|
||
} | ||
|
||
|
||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false, Inherited = true)] | ||
public class MessagePackFormatterAttribute : Attribute | ||
{ | ||
public Type FormatterType { get; private set; } | ||
public object[] Arguments { get; private set; } | ||
|
||
public MessagePackFormatterAttribute(Type formatterType) | ||
{ | ||
this.FormatterType = formatterType; | ||
} | ||
|
||
public MessagePackFormatterAttribute(Type formatterType, params object[] arguments) | ||
{ | ||
this.FormatterType = formatterType; | ||
this.Arguments = arguments; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
namespace MessagePack | ||
{ | ||
// safe accessor of Single/Double's underlying byte. | ||
// This code is borrowed from MsgPack-Cli https://github.com/msgpack/msgpack-cli | ||
|
||
[StructLayout(LayoutKind.Explicit)] | ||
internal struct Float32Bits | ||
{ | ||
[FieldOffset(0)] | ||
public readonly float Value; | ||
|
||
[FieldOffset(0)] | ||
public readonly Byte Byte0; | ||
|
||
[FieldOffset(1)] | ||
public readonly Byte Byte1; | ||
|
||
[FieldOffset(2)] | ||
public readonly Byte Byte2; | ||
|
||
[FieldOffset(3)] | ||
public readonly Byte Byte3; | ||
|
||
public Float32Bits(float value) | ||
{ | ||
this = default(Float32Bits); | ||
this.Value = value; | ||
} | ||
|
||
public Float32Bits(byte[] bigEndianBytes, int offset) | ||
{ | ||
this = default(Float32Bits); | ||
|
||
if (BitConverter.IsLittleEndian) | ||
{ | ||
this.Byte0 = bigEndianBytes[offset + 3]; | ||
this.Byte1 = bigEndianBytes[offset + 2]; | ||
this.Byte2 = bigEndianBytes[offset + 1]; | ||
this.Byte3 = bigEndianBytes[offset]; | ||
} | ||
else | ||
{ | ||
this.Byte0 = bigEndianBytes[offset]; | ||
this.Byte1 = bigEndianBytes[offset + 1]; | ||
this.Byte2 = bigEndianBytes[offset + 2]; | ||
this.Byte3 = bigEndianBytes[offset + 3]; | ||
} | ||
} | ||
} | ||
|
||
[StructLayout(LayoutKind.Explicit)] | ||
internal struct Float64Bits | ||
{ | ||
[FieldOffset(0)] | ||
public readonly double Value; | ||
|
||
[FieldOffset(0)] | ||
public readonly Byte Byte0; | ||
|
||
[FieldOffset(1)] | ||
public readonly Byte Byte1; | ||
|
||
[FieldOffset(2)] | ||
public readonly Byte Byte2; | ||
|
||
[FieldOffset(3)] | ||
public readonly Byte Byte3; | ||
|
||
[FieldOffset(4)] | ||
public readonly Byte Byte4; | ||
|
||
[FieldOffset(5)] | ||
public readonly Byte Byte5; | ||
|
||
[FieldOffset(6)] | ||
public readonly Byte Byte6; | ||
|
||
[FieldOffset(7)] | ||
public readonly Byte Byte7; | ||
|
||
public Float64Bits(double value) | ||
{ | ||
this = default(Float64Bits); | ||
this.Value = value; | ||
} | ||
|
||
public Float64Bits(byte[] bigEndianBytes, int offset) | ||
{ | ||
this = default(Float64Bits); | ||
|
||
if (BitConverter.IsLittleEndian) | ||
{ | ||
this.Byte0 = bigEndianBytes[offset + 7]; | ||
this.Byte1 = bigEndianBytes[offset + 6]; | ||
this.Byte2 = bigEndianBytes[offset + 5]; | ||
this.Byte3 = bigEndianBytes[offset + 4]; | ||
this.Byte4 = bigEndianBytes[offset + 3]; | ||
this.Byte5 = bigEndianBytes[offset + 2]; | ||
this.Byte6 = bigEndianBytes[offset + 1]; | ||
this.Byte7 = bigEndianBytes[offset]; | ||
} | ||
else | ||
{ | ||
this.Byte0 = bigEndianBytes[offset]; | ||
this.Byte1 = bigEndianBytes[offset + 1]; | ||
this.Byte2 = bigEndianBytes[offset + 2]; | ||
this.Byte3 = bigEndianBytes[offset + 3]; | ||
this.Byte4 = bigEndianBytes[offset + 4]; | ||
this.Byte5 = bigEndianBytes[offset + 5]; | ||
this.Byte6 = bigEndianBytes[offset + 6]; | ||
this.Byte7 = bigEndianBytes[offset + 7]; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.