Skip to content

Commit 812e189

Browse files
committed
Initial commit
1 parent 9b463fa commit 812e189

124 files changed

Lines changed: 7654 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

demo/Assembly-CSharp-vs.csproj

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.20506</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{C132594A-928C-86DF-54BB-28617E4DB357}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace></RootNamespace>
12+
<AssemblyName>Assembly-CSharp</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<BaseDirectory>Assets</BaseDirectory>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>Temp\bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE;UNITY_5_0_1;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;UNITY_IPHONE;ENABLE_RUNTIME_GI;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_NETWORK;UNITY_IPHONE_API;UNITY_IOS;ENABLE_TEXTUREID_MAP;PLAYERCONNECTION_LISTENS_FIXED_PORT;DEBUGGER_LISTENS_FIXED_PORT;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<NoWarn>0169</NoWarn>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>Temp\bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<NoWarn>0169</NoWarn>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.XML" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="UnityEngine">
42+
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
43+
</Reference>
44+
<Reference Include="UnityEditor">
45+
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
46+
</Reference>
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="Assets\NativeEdit\JsonObject.cs" />
50+
<Compile Include="Assets\NativeEdit\MiniJSON.cs" />
51+
<Compile Include="Assets\NativeEdit\NativeEditBox.cs" />
52+
<Compile Include="Assets\NativeEdit\PluginMsgHandler.cs" />
53+
<Compile Include="Assets\demo.cs" />
54+
<None Include="Assets\Plugins\Android\AndroidManifest.xml" />
55+
<Reference Include="UnityEngine.UI">
56+
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
57+
</Reference>
58+
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
59+
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
60+
</Reference>
61+
</ItemGroup>
62+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
63+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
64+
Other similar extension points exist, see Microsoft.Common.targets.
65+
<Target Name="BeforeBuild">
66+
</Target>
67+
<Target Name="AfterBuild">
68+
</Target>
69+
-->
70+
71+
</Project>

demo/Assembly-CSharp.csproj

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>10.0.20506</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{C132594A-928C-86DF-54BB-28617E4DB357}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<AppDesignerFolder>Properties</AppDesignerFolder>
11+
<RootNamespace></RootNamespace>
12+
<AssemblyName>Assembly-CSharp</AssemblyName>
13+
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
14+
<FileAlignment>512</FileAlignment>
15+
<BaseDirectory>Assets</BaseDirectory>
16+
</PropertyGroup>
17+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>Temp\bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE;UNITY_5_0_1;UNITY_5_0;UNITY_5;ENABLE_LICENSE_RENAME;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_NEW_HIERARCHY;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_NONPRO;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;PLATFORM_SUPPORTS_MONO;UNITY_IPHONE;ENABLE_RUNTIME_GI;ENABLE_SUBSTANCE;ENABLE_GAMECENTER;ENABLE_NETWORK;UNITY_IPHONE_API;UNITY_IOS;ENABLE_TEXTUREID_MAP;PLAYERCONNECTION_LISTENS_FIXED_PORT;DEBUGGER_LISTENS_FIXED_PORT;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;UNITY_TEAM_LICENSE;UNITY_PRO_LICENSE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
<NoWarn>0169</NoWarn>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>Temp\bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
<NoWarn>0169</NoWarn>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<Reference Include="System" />
38+
<Reference Include="System.XML" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="UnityEngine">
42+
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll</HintPath>
43+
</Reference>
44+
<Reference Include="UnityEditor">
45+
<HintPath>/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll</HintPath>
46+
</Reference>
47+
</ItemGroup>
48+
<ItemGroup>
49+
<Compile Include="Assets\NativeEdit\JsonObject.cs" />
50+
<Compile Include="Assets\NativeEdit\MiniJSON.cs" />
51+
<Compile Include="Assets\NativeEdit\NativeEditBox.cs" />
52+
<Compile Include="Assets\NativeEdit\PluginMsgHandler.cs" />
53+
<Compile Include="Assets\demo.cs" />
54+
<None Include="Assets\Plugins\Android\AndroidManifest.xml" />
55+
<Reference Include="UnityEngine.UI">
56+
<HintPath>/Applications/Unity/Unity.app/Contents/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
57+
</Reference>
58+
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
59+
<HintPath>/Applications/Unity/Unity.app/Contents/PlaybackEngines/iossupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
60+
</Reference>
61+
</ItemGroup>
62+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
63+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
64+
Other similar extension points exist, see Microsoft.Common.targets.
65+
<Target Name="BeforeBuild">
66+
</Target>
67+
<Target Name="AfterBuild">
68+
</Target>
69+
-->
70+
71+
</Project>

demo/Assets/NativeEdit.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
using UnityEngine;
2+
using System.Collections;
3+
using System.Collections.Generic;
4+
using System.Text;
5+
using System;
6+
7+
/*
8+
* Copyright (c) 2015 Kyungmin Bang
9+
*
10+
* Permission is hereby granted, free of charge, to any person obtaining
11+
* a copy of this software and associated documentation files (the
12+
* "Software"), to deal in the Software without restriction, including
13+
* without limitation the rights to use, copy, modify, merge, publish,
14+
* distribute, sublicense, and/or sell copies of the Software, and to
15+
* permit persons to whom the Software is furnished to do so, subject to
16+
* the following conditions:
17+
*
18+
* The above copyright notice and this permission notice shall be
19+
* included in all copies or substantial portions of the Software.
20+
*
21+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
25+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28+
*/
29+
30+
31+
/// <summary>
32+
/// JsonObject provide safe and type-compatible wrapper to access Json Element
33+
/// Safe means, even if a certain Json doesn't contain 'key', it doesn't crash.
34+
/// </summary>
35+
public class JsonObject : UnityEngine.Object {
36+
/// <summary>
37+
/// Supported object type : double, bool, string, List, Array!
38+
/// </summary>
39+
public Dictionary<string, System.Object> m_dict;
40+
41+
public JsonObject()
42+
{
43+
m_dict = new Dictionary<string, System.Object>();
44+
}
45+
46+
public JsonObject(string strJson)
47+
{
48+
m_dict = MiniJSON_Min.Json.Deserialize(strJson) as Dictionary<string,object>;
49+
}
50+
51+
public JsonObject(Dictionary<string, System.Object> dict)
52+
{
53+
m_dict = dict;
54+
}
55+
56+
public System.Object this[string key]
57+
{
58+
get { return m_dict[key]; }
59+
set { m_dict[key] = value; }
60+
}
61+
62+
public string getCmd() { return (string) m_dict["cmd"]; }
63+
64+
public string Serialize()
65+
{
66+
string strData = MiniJSON_Min.Json.Serialize(m_dict);
67+
return strData;
68+
}
69+
70+
//// Deserialize helper
71+
72+
private object GetDictValue(string key)
73+
{
74+
System.Object obj;
75+
if (m_dict.TryGetValue(key, out obj))
76+
{
77+
return ((obj != null) ? obj : "");
78+
}
79+
return "";
80+
}
81+
82+
public bool keyExist(string key)
83+
{
84+
System.Object obj;
85+
if (m_dict.TryGetValue(key, out obj))
86+
{
87+
return true;
88+
}
89+
return false;
90+
}
91+
92+
public Dictionary<string, object> GetJsonDict(string key)
93+
{
94+
System.Object obj;
95+
if (m_dict.TryGetValue(key, out obj)) return (Dictionary<string, object>) obj;
96+
return new Dictionary<string, object>();
97+
}
98+
99+
public JsonObject GetJsonObject(string key)
100+
{
101+
Dictionary<string, object> dict = this.GetJsonDict(key);
102+
return new JsonObject(dict);
103+
}
104+
105+
public bool GetBool(string key)
106+
{
107+
bool val;
108+
if (bool.TryParse(this.GetDictValue(key).ToString(), out val)) return val;
109+
return false;
110+
}
111+
112+
public int GetInt(string key)
113+
{
114+
int val;
115+
if (int.TryParse(this.GetDictValue(key).ToString(), out val)) return val;
116+
return 0;
117+
}
118+
119+
public float GetFloat(string key)
120+
{
121+
float val;
122+
if (float.TryParse(this.GetDictValue(key).ToString(), out val)) return val;
123+
return 0.0f;
124+
}
125+
126+
public string GetString(string key)
127+
{
128+
return (string) this.GetDictValue(key).ToString();
129+
}
130+
131+
public object GetEnum(System.Type type, string key)
132+
{
133+
string obj = (string) this.GetDictValue(key);
134+
if (obj.Length > 0)
135+
{
136+
return System.Enum.Parse(type, obj);
137+
}
138+
return 0;
139+
}
140+
141+
public List<JsonObject> GetListJsonObject(string key)
142+
{
143+
System.Object obj;
144+
List<JsonObject> retList = new List<JsonObject>();
145+
if (m_dict.TryGetValue(key, out obj))
146+
{
147+
foreach(object elem in (List<object>) obj)
148+
{
149+
retList.Add(new JsonObject( (Dictionary<string, System.Object>) elem));
150+
}
151+
}
152+
return retList;
153+
}
154+
}

demo/Assets/NativeEdit/JsonObject.cs.meta

Lines changed: 12 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)