Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,5 @@ UnityProject/.idea/*
UnityProject/HotUpdateScripts/.vs/*
UnityProject/Library/*
UnityProject/Temp/*
UnityProject/obj/*
UnityProject/Assembly-CSharp-Editor.csproj
UnityProject/Assembly-CSharp.csproj
UnityProject/ILRuntime.csproj
UnityProject/UnityProject.sln
UnityProject/Malee.ReorderableList.Editor.csproj
UnityProject/Malee.ReorderableList.csproj
UnityProject/HotUpdateScripts/HotUpdateScripts/obj/*
UnityProject/DLC/*

737 changes: 737 additions & 0 deletions UnityProject/Assembly-CSharp-Editor.csproj

Large diffs are not rendered by default.

783 changes: 783 additions & 0 deletions UnityProject/Assembly-CSharp.csproj

Large diffs are not rendered by default.

Binary file added UnityProject/Assets/EPPlus.dll
Binary file not shown.
33 changes: 33 additions & 0 deletions UnityProject/Assets/EPPlus.dll.meta

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

7 changes: 6 additions & 1 deletion UnityProject/Assets/HotUpdateResources/Scene/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ MonoBehaviour:
- fieldType: 13
fieldName: txtFile
value: Assets/HotUpdateResources/TextAsset/Text.txt
- Namespace: HotUpdateScripts
Class: ExcelTest
ActiveAfter: 1
RequireBindFields: 0
Fields:
array: []
--- !u!4 &627944075
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -399,7 +405,6 @@ MonoBehaviour:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
Expand Down
19 changes: 13 additions & 6 deletions UnityProject/HotUpdateScripts/HotUpdateScripts.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
# Visual Studio Version 16
VisualStudioVersion = 16.0.30104.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HotUpdateScripts", "HotUpdateScripts\HotUpdateScripts.csproj", "{E461BAE8-B218-4AAE-8773-0C18C85110E4}"
EndProject
Global
Expand All @@ -9,10 +10,16 @@ Global
Release|anycpu = Release|anycpu
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Debug|anycpu.ActiveCfg = Debug|anycpu
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Debug|anycpu.Build.0 = Debug|anycpu
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Release|anycpu.ActiveCfg = Release|anycpu
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Release|anycpu.Build.0 = Release|anycpu
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Debug|anycpu.ActiveCfg = Debug|Any CPU
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Debug|anycpu.Build.0 = Debug|Any CPU
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Release|anycpu.ActiveCfg = Release|Any CPU
{E461BAE8-B218-4AAE-8773-0C18C85110E4}.Release|anycpu.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB7233AF-9EFA-4DAC-B014-537AB5D2DD0A}
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System.IO;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using UnityEngine;

namespace HotUpdateScripts
{
class ExcelTest : MonoBehaviour
{
public void Start()
{
CreateExcel();
ReadExcel();
}

void CreateExcel()
{
string outPutDir = Application.dataPath + "\\" + "MyExcel.xls";
FileInfo newFile = new FileInfo(outPutDir);
if (newFile.Exists)
{
newFile.Delete(); // ensures we create a new workbook
Debug.Log("Clear ");
newFile = new FileInfo(outPutDir);
}

using (ExcelPackage package = new ExcelPackage(newFile))
{
ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("我的Excel");
worksheet.Cells[1, 1].Value = "序号";
worksheet.Cells[1, 2].Value = "姓名";
worksheet.Cells[1, 3].Value = "电话";
package.Save();
Debug.Log("创建Excel成功");
}
}
void ReadExcel() {
string outPutDir = Application.dataPath + "\\" + "MyExcel.xls";
using ( ExcelPackage package = new ExcelPackage(new FileStream(outPutDir, FileMode.Open)) )
{
for ( int i = 1; i <= package.Workbook.Worksheets.Count; ++i )
{
ExcelWorksheet sheet = package.Workbook.Worksheets[i];
for ( int j = sheet.Dimension.Start.Column, k = sheet.Dimension.End.Column; j <= k; j++ )
{
for ( int m = sheet.Dimension.Start.Row, n = sheet.Dimension.End.Row; m <= n; m++ )
{
string str = sheet.GetValue(m, j).ToString();
if ( str != null )
{
// do something
Debug.Log(str);
}
}
}
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand All @@ -7,8 +7,9 @@
<OutputType>Library</OutputType>
<RootNamespace>HotUpdateScripts</RootNamespace>
<AssemblyName>HotUpdateScripts</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<Description>JEngine</Description>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|anycpu' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -62,9 +63,7 @@
<HintPath>Dlls\UnityEngine.TextRenderingModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="Examples\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
Expand Down
Binary file not shown.
Binary file not shown.
Loading