[TASK] Initial commit with basic product setup

This commit is contained in:
2019-08-18 13:50:14 +02:00
commit 01a66a8e1f
2548 changed files with 167528 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8134eca76f1ac42458f5d4cfdb8b4266
folderAsset: yes
timeCreated: 1505842222
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 460f08d286db7064f87b580a784ba0de
folderAsset: yes
timeCreated: 1500149996
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f1709b7b4aaad8547ae8aecb2312cbd6
folderAsset: yes
timeCreated: 1476664160
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,208 @@
<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>Documentation.md</title><style type='text/css'>html, body {overflow-x: initial !important;}html { font-size: 14px; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1rem; line-height: 1.42857; color: rgb(51, 51, 51); overflow-x: hidden; background-color: rgb(255, 255, 255); }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: rgb(181, 214, 252); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; word-wrap: break-word; position: relative; padding-bottom: 70px; white-space: pre-wrap; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
@media screen and (max-width: 500px) {
body.typora-export { padding-left: 0px; padding-right: 0px; }
.CodeMirror-sizer { margin-left: 0px !important; }
.CodeMirror-gutters { display: none !important; }
}
.typora-export #write { margin: 0px auto; }
#write > p:first-child, #write > ul:first-child, #write > ol:first-child, #write > pre:first-child, #write > blockquote:first-child, #write > div:first-child, #write > table:first-child { margin-top: 30px; }
img { max-width: 100%; }
input, button, select, textarea { color: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
::before, ::after, * { box-sizing: border-box; }
#write p, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write div, #write pre { width: inherit; }
#write p, #write h1, #write h2, #write h3, #write h4, #write h5, #write h6 { position: relative; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
p { -webkit-margin-before: 1rem; -webkit-margin-after: 1rem; -webkit-margin-start: 0px; -webkit-margin-end: 0px; }
.mathjax-block { margin-top: 0px; margin-bottom: 0px; -webkit-margin-before: 0rem; -webkit-margin-after: 0rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: bold; font-style: italic; }
a { cursor: pointer; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; margin: 4px 0px 0px; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 80px; }
.CodeMirror-gutters { border-right-width: 0px; background-color: inherit; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
pre { white-space: pre-wrap; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; position: relative !important; background: inherit; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
.md-fences .CodeMirror.CodeMirror-wrap { top: -1.6em; margin-bottom: -1.6em; }
.md-fences.mock-cm { white-space: pre-wrap; }
.show-fences-line-number .md-fences { padding-left: 0px; }
.show-fences-line-number .md-fences.mock-cm { padding-left: 40px; }
.footnotes { color: rgb(136, 136, 136); font-size: 0.9rem; padding-top: 1em; padding-bottom: 1em; }
.footnotes + .footnotes { margin-top: -1em; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; text-decoration: none; color: rgb(51, 51, 51); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 1rem; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: normal; text-align: left; box-sizing: content-box; direction: ltr; background: transparent; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li p, li .mathjax-block { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; }
@media print {
html, body { height: 100%; }
.typora-export * { -webkit-print-color-adjust: exact; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; orphans: 2; }
p { orphans: 4; }
html.blink-to-pdf { font-size: 13px; }
.typora-export #write { padding-left: 1cm; padding-right: 1cm; }
.typora-export #write::after { height: 0px; }
@page { margin: 20mm 0mm; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 2.86rem; white-space: pre-wrap; display: block; background: rgb(204, 204, 204); }
p > .md-image:only-child { display: inline-block; width: 100%; text-align: center; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.mathjax-block { white-space: pre; overflow: hidden; width: 100%; }
p + .mathjax-block { margin-top: -1.143rem; }
.mathjax-block:not(:empty)::after { display: none; }
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: none; box-shadow: none; }
.task-list { list-style-type: none; }
.task-list-item { position: relative; padding-left: 1em; }
.task-list-item input { position: absolute; top: 0px; left: 0px; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc::after, .md-toc-content::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); text-decoration: none; }
.md-toc-inner:hover { }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: bold; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
.md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
.md-toc-h4 .md-toc-inner { margin-left: 5em; }
.md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
.md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
.md-tag { opacity: 0.5; }
code { text-align: left; }
h1 .md-tag, h2 .md-tag, h3 .md-tag, h4 .md-tag, h5 .md-tag, h6 .md-tag { font-weight: initial; opacity: 0.35; }
a.md-header-anchor.md-print-anchor { border: none !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: none !important; text-decoration: initial !important; text-shadow: initial !important; background: transparent !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.mathjax-block .MathJax_SVG_Display { text-align: center; margin: 1em 0em; position: relative; text-indent: 0px; max-width: none; max-height: none; min-width: 0px; min-height: 0px; width: 100%; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: monospace; }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: normal; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none; }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: normal; src: local("Open Sans Regular"), url("./github/400.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: normal; src: local("Open Sans Italic"), url("./github/400i.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: normal; font-weight: bold; src: local("Open Sans Bold"), url("./github/700.woff") format("woff"); }
@font-face { font-family: "Open Sans"; font-style: italic; font-weight: bold; src: local("Open Sans Bold Italic"), url("./github/700i.woff") format("woff"); }
html { font-size: 16px; }
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
#write { max-width: 860px; margin: 0px auto; padding: 20px 30px 100px; }
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
body > :first-child { margin-top: 0px !important; }
body > :last-child { margin-bottom: 0px !important; }
a { color: rgb(65, 131, 196); }
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
h1 tt, h1 code { font-size: inherit; }
h2 tt, h2 code { font-size: inherit; }
h3 tt, h3 code { font-size: inherit; }
h4 tt, h4 code { font-size: inherit; }
h5 tt, h5 code { font-size: inherit; }
h6 tt, h6 code { font-size: inherit; }
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); }
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); }
h3 { font-size: 1.5em; line-height: 1.43; }
h4 { font-size: 1.25em; }
h5 { font-size: 1em; }
h6 { font-size: 1em; color: rgb(119, 119, 119); }
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
li > ol, li > ul { margin: 0px; }
hr { height: 4px; padding: 0px; margin: 16px 0px; border-width: 0px 0px 1px; border-style: none none solid; overflow: hidden; box-sizing: content-box; border-bottom-color: rgb(221, 221, 221); background-color: rgb(231, 231, 231); }
body > h2:first-child { margin-top: 0px; padding-top: 0px; }
body > h1:first-child { margin-top: 0px; padding-top: 0px; }
body > h1:first-child + h2 { margin-top: 0px; padding-top: 0px; }
body > h3:first-child, body > h4:first-child, body > h5:first-child, body > h6:first-child { margin-top: 0px; padding-top: 0px; }
a:first-child h1, a:first-child h2, a:first-child h3, a:first-child h4, a:first-child h5, a:first-child h6 { margin-top: 0px; padding-top: 0px; }
h1 p, h2 p, h3 p, h4 p, h5 p, h6 p { margin-top: 0px; }
li p.first { display: inline-block; }
ul, ol { padding-left: 30px; }
ul:first-child, ol:first-child { margin-top: 0px; }
ul:last-child, ol:last-child { margin-bottom: 0px; }
blockquote { border-left-width: 4px; border-left-style: solid; border-left-color: rgb(221, 221, 221); padding: 0px 15px; color: rgb(119, 119, 119); }
blockquote blockquote { padding-right: 0px; }
table { padding: 0px; }
table tr { border-top-width: 1px; border-top-style: solid; border-top-color: rgb(204, 204, 204); margin: 0px; padding: 0px; background-color: white; }
table tr:nth-child(2n) { background-color: rgb(248, 248, 248); }
table tr th { font-weight: bold; border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
table tr td { border: 1px solid rgb(204, 204, 204); text-align: left; margin: 0px; padding: 6px 13px; }
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
.CodeMirror-gutters { border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); }
.md-fences, code, tt { border: 1px solid rgb(221, 221, 221); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; background-color: rgb(248, 248, 248); }
.md-fences { margin-bottom: 15px; margin-top: 15px; padding: 8px 1em 6px; }
.task-list { padding-left: 0px; }
.task-list-item { padding-left: 32px; }
.task-list-item input { top: 3px; left: 8px; }
@media screen and (min-width: 914px) {
}
@media print {
html { font-size: 13px; }
table, pre { break-inside: avoid; }
pre { word-wrap: break-word; }
}
.md-fences { background-color: rgb(248, 248, 248); }
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; background-color: rgb(247, 247, 247); }
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
.md-image > .md-meta { border: 1px solid rgb(221, 221, 221); border-radius: 3px; font-family: Consolas, "Liberation Mono", Courier, monospace; padding: 2px 4px 0px; font-size: 0.9em; color: inherit; background-color: rgb(248, 248, 248); }
.md-tag { color: inherit; }
.md-toc { margin-top: 20px; padding-bottom: 20px; }
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
#typora-quick-open-item { border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; background-color: rgb(250, 250, 250); }
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.117647); }
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
</style>
</head>
<body class='typora-export ' >
<div id='write' class = 'is-node'><h1><a name='header-c1' class='md-header-anchor '></a>Line Endings Fixer</h1><p></p><h2><a name='header-c8' class='md-header-anchor '></a>Overview</h2><p>This asset contains a script that automatically fixes line endings on your script based. It&#39;ll watch the logs of the console for reports of mixed line endings and automatically fix it for you based on your line-ending choice.</p><h2><a name='header-c11' class='md-header-anchor '></a>Configuration</h2><p>To configure which type of line ending you want, just go to <strong>Tools</strong> &gt; <strong>Line Endings Fixer</strong> and select which line ending you want for your project.</p><p> <img src='Images\settings.png' alt='settings' /></p><p>Note that there&#39;s no &quot;batch&quot; processing, only scripts reported on console will be fixed. </p><h2><a name='header-c18' class='md-header-anchor '></a>Contact</h2><p>If you have any questions, drop me an email at <a href='mailto://wolfulus@gmail.com' target='_blank' >wolfulus@gmail.com</a>. </p><p>Thank you!</p><p><a href='https://wolfulus.com/' target='_blank' >https://wolfulus.com/</a>
<a href='https://twitter.com/wolfulus' target='_blank' >https://twitter.com/wolfulus</a></p></div>
</body>
</html>

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f972ffd62a978474287a70b8e17d7049
timeCreated: 1476664671
licenseType: Store
TextScriptImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
# Line Endings Fixer
## Overview
This asset contains a script that automatically fixes line endings on your script based. It'll watch the logs of the console for reports of mixed line endings and automatically fix it for you based on your line-ending choice.
## Configuration
To configure which type of line ending you want, just go to **Tools** > **Line Endings Fixer** and select which line ending you want for your project.
![settings](Images\settings.png)
Note that there's no "batch" processing, only scripts reported on console will be fixed.
## Contact
If you have any questions, drop me an email at wolfulus@gmail.com.
Thank you!
https://wolfulus.com/
https://twitter.com/wolfulus

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 60dfa05c841f3fd428301f4c53ef1d8c
timeCreated: 1476664670
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e3f231d606836d47bf6cc739fe46b84
timeCreated: 1476664670
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: e44efaf0c62589845829e28d295e4c5d
folderAsset: yes
timeCreated: 1476664670
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@@ -0,0 +1,59 @@
fileFormatVersion: 2
guid: bd2078584a71a604ba5291f0213c11d2
timeCreated: 1476664670
licenseType: Store
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 1
linearTexture: 0
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 7
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: -1
mipBias: -1
wrapMode: -1
nPOTScale: 1
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: -1
buildTargetSettings: []
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 61a1b1c75661f7949a65807110037a40
folderAsset: yes
timeCreated: 1500149996
licenseType: Store
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,46 @@
using System;
namespace WoLfulus.LineEnding
{
[Flags]
public enum Mode
{
Error = 1,
Assert = 2,
Log = 4,
Fatal = 16,
DontPreprocessCondition = 32,
AssetImportError = 64,
AssetImportWarning = 128,
ScriptingError = 256,
ScriptingWarning = 512,
ScriptingLog = 1024,
ScriptCompileError = 2048,
ScriptCompileWarning = 4096,
StickyError = 8192,
MayIgnoreLineNumber = 16384,
ReportBug = 32768,
DisplayPreviousErrorInStatusBar = 65536,
ScriptingException = 131072,
DontExtractStacktrace = 262144,
ShouldClearOnPlay = 524288,
GraphCompileError = 1048576,
ScriptingAssertion = 2097152,
}
[Flags]
public enum ConsoleFlags
{
Collapse = 1,
ClearOnPlay = 2,
ErrorPause = 4,
Verbose = 8,
StopForAssert = 16,
StopForError = 32,
Autoscroll = 64,
LogLevelLog = 128,
LogLevelWarning = 256,
LogLevelError = 512,
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 66ccfdf2ae714c24fbb83439bccd54f6
timeCreated: 1500149996
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,201 @@
using System.Collections.Generic;
using System.IO;
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEngine;
//#pragma warning disable 0414
namespace WoLfulus.LineEnding
{
/// <summary>
/// Initialize on load
/// </summary>
[InitializeOnLoad]
public class FileMonitor
{
private const string WindowsStyle = "\r\n";
private const string UnixStyle = "\n";
private const string MacStyle = "\r";
private const string MenuPrefix = "Tools/Line Endings Fixer/";
private const string MenuWindows = MenuPrefix + "Windows";
private const string MenuUnix = MenuPrefix + "Unix";
private const string MenuMac = MenuPrefix + "Mac OSX";
private const string ConfigurationId = "WoLfulus_LEF_Type";
/// <summary>
/// Initializer
/// </summary>
static FileMonitor()
{
EditorApplication.delayCall += () =>
{
if (!EditorPrefs.HasKey(ConfigurationId))
{
EditorPrefs.SetString(ConfigurationId, "win");
}
Menu.SetChecked(MenuWindows, false);
Menu.SetChecked(MenuUnix, false);
Menu.SetChecked(MenuMac, false);
var type = EditorPrefs.GetString(ConfigurationId);
if (type == "win")
{
Menu.SetChecked(MenuWindows, true);
}
else if (type == "unix")
{
Menu.SetChecked(MenuUnix, true);
}
else if (type == "mac")
{
Menu.SetChecked(MenuMac, true);
}
};
}
/// <summary>
/// Windows style
/// </summary>
[MenuItem(MenuWindows)]
private static void SetWindows()
{
Menu.SetChecked(MenuWindows, true);
Menu.SetChecked(MenuUnix, false);
Menu.SetChecked(MenuMac, false);
Debug.Log("Line endings changed to Windows");
EditorPrefs.SetString(ConfigurationId, "win");
}
/// <summary>
/// Windows style
/// </summary>
[MenuItem(MenuUnix)]
private static void SetUnix()
{
Menu.SetChecked(MenuWindows, false);
Menu.SetChecked(MenuUnix, true);
Menu.SetChecked(MenuMac, false);
Debug.Log("Line endings changed to Unix");
EditorPrefs.SetString(ConfigurationId, "unix");
}
/// <summary>
/// Windows style
/// </summary>
[MenuItem(MenuMac)]
private static void SetMac()
{
Menu.SetChecked(MenuWindows, false);
Menu.SetChecked(MenuUnix, false);
Menu.SetChecked(MenuMac, true);
Debug.Log("Line endings changed to Mac OSX");
EditorPrefs.SetString(ConfigurationId, "mac");
}
/// <summary>
/// Collect files from log entries
/// </summary>
private static IEnumerable<string> Collect()
{
var files = new List<string>();
var flags = LogEntries.consoleFlags;
LogEntries.SetConsoleFlag((int)ConsoleFlags.LogLevelLog, false);
LogEntries.SetConsoleFlag((int)ConsoleFlags.LogLevelWarning, true);
LogEntries.SetConsoleFlag((int)ConsoleFlags.LogLevelError, false);
LogEntries.StartGettingEntries();
var count = LogEntries.GetCount();
for (int i = 0; i < count; i++)
{
LogEntries.GetEntryInternal(i, LogEntry.instance);
if ((LogEntry.mode & Mode.AssetImportWarning) != 0)
{
var condition = LogEntry.condition;
if (!string.IsNullOrEmpty(condition) && condition.Contains("inconsistent line endings"))
{
files.Add(LogEntry.file);
}
}
}
LogEntries.EndGettingEntries();
LogEntries.consoleFlags = flags;
return files.ToArray();
}
/// <summary>
/// Fix stuff
/// </summary>
static void FixFiles()
{
var files = Collect();
var endingType = EditorPrefs.GetString(ConfigurationId);
var ending = "\r\n";
if (endingType == "win")
{
ending = WindowsStyle;
}
else if (endingType == "unix")
{
ending = UnixStyle;
}
else if (endingType == "mac")
{
ending = MacStyle;
}
else
{
Debug.Log("Line Endings Fixer settings not detected. You might want to select a line ending style.");
return;
}
int filesFixed = 0;
foreach (var file in files)
{
if (!File.Exists(file))
{
Debug.LogError("File '" + file + "' is reported to have wrong line endings but the file itself couldn't be found.");
continue;
}
var fileContents = File.ReadAllText(file).Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", ending);
File.WriteAllText(file, fileContents);
EditorApplication.delayCall += () =>
{
AssetDatabase.ImportAsset(file, ImportAssetOptions.ForceUpdate);
};
filesFixed++;
}
if (filesFixed > 0)
{
Debug.Log("Fixed " + filesFixed + " files with mixed line endings.");
}
}
/// <summary>
/// Scripts reloaded
/// </summary>
[DidReloadScripts]
static void ScriptsReloaded()
{
if (!EditorApplication.isPlaying)
{
FixFiles();
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 878946dea992d444bbb127ad0bd8aa95
timeCreated: 1500149996
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,150 @@
using System;
using System.Reflection;
using UnityEditor;
namespace WoLfulus.LineEnding
{
[InitializeOnLoad]
public static class LogEntries
{
private static Type _type;
private static PropertyInfo _consoleFlags;
private static MethodInfo _SetConsoleFlag;
private static MethodInfo _RowGotDoubleClicked;
private static MethodInfo _GetStatusText;
private static MethodInfo _GetStatusMask;
private static MethodInfo _StartGettingEntries;
private static MethodInfo _EndGettingEntries;
private static MethodInfo _GetFirstTwoLinesEntryTextAndModeInternal;
private static MethodInfo _GetEntryCount;
private static MethodInfo _GetEntryInternal;
private static MethodInfo _GetCount;
private static MethodInfo _GetCountsByType;
private static MethodInfo _GetStatusViewErrorIndex;
private static MethodInfo _ClickStatusBar;
private static MethodInfo _Clear;
static LogEntries()
{
var flags = BindingFlags.Static | BindingFlags.Public;
if (_type == null)
{
Assembly assembly = Assembly.GetAssembly(typeof(Editor));
_type = assembly.GetType("UnityEditorInternal.LogEntries");
if (_type == null) // 2017 Fix
{
_type = assembly.GetType("UnityEditor.LogEntries");
}
_consoleFlags = _type.GetProperty("consoleFlags", flags);
_SetConsoleFlag = _type.GetMethod("SetConsoleFlag", flags);
_RowGotDoubleClicked = _type.GetMethod("RowGotDoubleClicked", flags);
_GetStatusText = _type.GetMethod("GetStatusText", flags);
_GetStatusMask = _type.GetMethod("GetStatusMask", flags);
_StartGettingEntries = _type.GetMethod("StartGettingEntries", flags);
_EndGettingEntries = _type.GetMethod("EndGettingEntries", flags);
_GetFirstTwoLinesEntryTextAndModeInternal = _type.GetMethod("GetFirstTwoLinesEntryTextAndModeInternal", flags);
_GetEntryCount = _type.GetMethod("GetEntryCount", flags);
_GetEntryInternal = _type.GetMethod("GetEntryInternal", flags);
_GetCount = _type.GetMethod("GetCount", flags);
_GetCountsByType = _type.GetMethod("GetCountsByType", flags);
_GetStatusViewErrorIndex = _type.GetMethod("GetStatusViewErrorIndex", flags);
_ClickStatusBar = _type.GetMethod("ClickStatusBar", flags);
_Clear = _type.GetMethod("Clear", flags);
}
}
public static int consoleFlags
{
get
{
return (int)_consoleFlags.GetValue(null, null);
}
set
{
_consoleFlags.SetValue(null, value, null);
}
}
public static void RowGotDoubleClicked(int index)
{
_RowGotDoubleClicked.Invoke(null, new object[1] { index });
}
public static string GetStatusText()
{
return (string)_GetStatusText.Invoke(null, new object[0]);
}
public static int GetStatusMask()
{
return (int)_GetStatusMask.Invoke(null, new object[0]);
}
public static int StartGettingEntries()
{
return (int)_StartGettingEntries.Invoke(null, new object[0]);
}
public static void SetConsoleFlag(int bit, bool value)
{
_SetConsoleFlag.Invoke(null, new object[2] { bit, value });
}
public static void EndGettingEntries()
{
_EndGettingEntries.Invoke(null, new object[0]);
}
public static int GetCount()
{
return (int)_GetCount.Invoke(null, new object[0]);
}
public static void GetCountsByType(ref int errorCount, ref int warningCount, ref int logCount)
{
_GetCountsByType.Invoke(null, new object[3] { errorCount, warningCount, logCount });
}
public static void GetFirstTwoLinesEntryTextAndModeInternal(int row, ref int mask, ref string outString)
{
_GetFirstTwoLinesEntryTextAndModeInternal.Invoke(null, new object[3] { row, mask, outString });
}
public static bool GetEntryInternal(int row, object outputEntry)
{
return (bool)_GetEntryInternal.Invoke(null, new object[2] { row, outputEntry });
}
public static int GetEntryCount(int row)
{
return (int)_GetEntryCount.Invoke(null, new object[1] { row });
}
public static void Clear()
{
_Clear.Invoke(null, new object[0]);
}
public static int GetStatusViewErrorIndex()
{
return (int)_GetStatusViewErrorIndex.Invoke(null, new object[0]);
}
public static void ClickStatusBar(int count)
{
_ClickStatusBar.Invoke(null, new object[1] { count });
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 99af3a8e663ff6e41a5551d6b28f7b91
timeCreated: 1500149996
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,117 @@
using System;
using System.Reflection;
using UnityEditor;
namespace WoLfulus.LineEnding
{
public static class LogEntry
{
public static object instance = null;
public static string condition
{
get
{
return (string)_condition.GetValue(instance);
}
}
public static int errorNum
{
get
{
return (int)_errorNum.GetValue(instance);
}
}
public static string file
{
get
{
return (string)_file.GetValue(instance);
}
}
public static int line
{
get
{
return (int)_line.GetValue(instance);
}
}
public static Mode mode
{
get
{
return (Mode)((int)_mode.GetValue(instance));
}
}
public static int instanceID
{
get
{
return (int)_instanceID.GetValue(instance);
}
}
public static int identifier
{
get
{
return (int)_identifier.GetValue(instance);
}
}
public static int isWorldPlaying
{
get
{
return (int)_isWorldPlaying.GetValue(instance);
}
}
private static Type _type = null;
private static FieldInfo _condition;
private static FieldInfo _errorNum;
private static FieldInfo _file;
private static FieldInfo _line;
private static FieldInfo _mode;
private static FieldInfo _instanceID;
private static FieldInfo _identifier;
private static FieldInfo _isWorldPlaying;
static LogEntry()
{
Initialize();
}
static void Initialize()
{
if (_type == null)
{
var flags = BindingFlags.Instance | BindingFlags.Public;
var assembly = Assembly.GetAssembly(typeof(Editor));
_type = assembly.GetType("UnityEditorInternal.LogEntry");
if (_type == null) // 2017 Fix
{
_type = assembly.GetType("UnityEditor.LogEntry");
}
_condition = _type.GetField("condition", flags);
_errorNum = _type.GetField("errorNum", flags);
_file = _type.GetField("file", flags);
_line = _type.GetField("line", flags);
_mode = _type.GetField("mode", flags);
_instanceID = _type.GetField("instanceID", flags);
_identifier = _type.GetField("identifier", flags);
_isWorldPlaying = _type.GetField("isWorldPlaying", flags);
instance = Activator.CreateInstance(_type);
}
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ef774846cf2b8b2409ad3a7a2334828e
timeCreated: 1500149996
licenseType: Store
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: