commit a4303103247e7c1777b0572adc2be594af6395ac Author: Jonathan Riedel Date: Thu May 2 18:50:57 2024 +0200 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..426d76d --- /dev/null +++ b/.gitignore @@ -0,0 +1,398 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..1864ded --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Plugin.cs b/Plugin.cs new file mode 100644 index 0000000..8f0cefd --- /dev/null +++ b/Plugin.cs @@ -0,0 +1,143 @@ +using BepInEx; +using HarmonyLib; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; + +namespace SpacemarketSimulator +{ + [BepInPlugin(PluginInfo.PLUGIN_GUID, PluginInfo.PLUGIN_NAME, PluginInfo.PLUGIN_VERSION)] + public class Plugin : BaseUnityPlugin + { + public const string SpaceShader = "Universal Render Pipeline/Lit"; + private void Awake() + { + Logger.LogInfo($"Plugin {PluginInfo.PLUGIN_GUID} is loaded! Applying patch..."); + Harmony harmony = new Harmony(PluginInfo.PLUGIN_GUID); + harmony.PatchAll(); + + foreach(var shader in Resources.FindObjectsOfTypeAll()) + { + Logger.LogInfo("Available shader: " + shader.name); + } + + SceneManager.sceneLoaded += SceneManager_sceneLoaded; + } + private Dictionary TextureCache { get; set; } = new(); + public static GameObject Player { get; set; } + private Texture2D LoadTexture(string name) + { + if (TextureCache.ContainsKey(name)) return TextureCache[name]; + byte[] data = (byte[])Properties.Resources.ResourceManager.GetObject(name); + Texture2D tex = new Texture2D(1024, 1024); + tex.LoadImage(data); + TextureCache[name] = tex; + return tex; + } + private void ApplySkybox(Transform container) + { + float skyboxDistance = 20; + float skyboxScale = 4; + PrimitiveType type = PrimitiveType.Plane; + + var xmPlane = GameObject.CreatePrimitive(type); + xmPlane.name = "xmPlane"; + var xpPlane = GameObject.CreatePrimitive(type); + xpPlane.name = "xpPlane"; + + var ymPlane = GameObject.CreatePrimitive(type); + ymPlane.name = "ymPlane"; + var ypPlane = GameObject.CreatePrimitive(type); + ypPlane.name = "ypPlane"; + + var zmPlane = GameObject.CreatePrimitive(type); + zmPlane.name = "zmPlane"; + var zpPlane = GameObject.CreatePrimitive(type); + zpPlane.name = "zpPlane"; + + var list = new List<(GameObject plane, string texture)> { (xpPlane, "front_galaxyfire1"), (xmPlane, "back_galaxyfire1"), (ypPlane, "down_galaxyfire1"), (ymPlane, "up_galaxyfire1"), (zpPlane, "left_galaxyfire1"), (zmPlane, "right_galaxyfire1") }; + list.ForEach(x => + { + x.plane.transform.SetParent(container); + var rend = x.plane.GetComponent(); + rend.material.shader = Shader.Find(SpaceShader); + rend.material.mainTexture = LoadTexture(x.texture); + }); + + var ymtd = TransformDefiner.AddToGameObject(ymPlane); + ymtd.localScale = new Vector3(skyboxScale, 1, skyboxScale); + ymtd.eulerAngles = new Vector3(0, 90, 0); + ymtd.position = new Vector3(0, -skyboxDistance + 0.001f, 0); + + var yptd = TransformDefiner.AddToGameObject(ypPlane); + yptd.position = new Vector3(0, skyboxDistance - 0.001f, 0); + yptd.eulerAngles = new Vector3(0, 90, 0); + yptd.localScale = new Vector3(skyboxScale, 1, -skyboxScale); + + var xmtd = TransformDefiner.AddToGameObject(xmPlane); + xmtd.position = new Vector3(-skyboxDistance, 0, 0); + xmtd.eulerAngles = new Vector3(90, 0, 90); + xmtd.localScale = new Vector3(skyboxScale, 1, -skyboxScale); + + var xptd = TransformDefiner.AddToGameObject(xpPlane); + xptd.localScale = new Vector3(skyboxScale, 1, skyboxScale); + xptd.position = new Vector3(skyboxDistance, 0, 0); + xptd.eulerAngles = new Vector3(-90, 0, 90); + + var zmtd = TransformDefiner.AddToGameObject(zmPlane); + zmtd.position = new Vector3(0, 0, -skyboxDistance); + zmtd.eulerAngles = new Vector3(90, 0, 180); + zmtd.localScale = new Vector3(skyboxScale, 1, -skyboxScale); + + var zptd = TransformDefiner.AddToGameObject(zpPlane); + zptd.localScale = new Vector3(skyboxScale, 1, skyboxScale); + zptd.position = new Vector3(0, 0, skyboxDistance); + zptd.eulerAngles = new Vector3(-90, 0, 0); + } + public void Update() + { + if(Input.GetKeyDown(KeyCode.Backspace)) + { + Player.transform.position = new Vector3(4.52f, -0.06f, 4.85f); + } + } + private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) + { + var standardEnvironmentContainer = GameObject.Find("Environment v0.1.1"); + if (standardEnvironmentContainer == null) return; + standardEnvironmentContainer.SetActive(false); + + var streetLightsContainer = GameObject.Find("Street Lights"); + streetLightsContainer.SetActive(false); + + Player = GameObject.Find("Player"); + + var newContainer = new GameObject("Space Environment").transform; + newContainer.SetParent(standardEnvironmentContainer.transform.parent); + + var skyboxContainer = new GameObject("Skybox").transform; + skyboxContainer.SetParent(newContainer); + + GameObject platform = GameObject.CreatePrimitive(PrimitiveType.Plane); + platform.transform.localScale = new Vector3(1, 1, 1); + platform.transform.position = new Vector3(6, 0, 6); + platform.transform.SetParent(newContainer); + + var renderer = platform.GetComponent(); + renderer.material.shader = Shader.Find("Universal Render Pipeline/Lit"); + renderer.material.mainTexture = LoadTexture("metalgrid3_basecolor"); + renderer.material.SetTexture("_NORMALMAP", LoadTexture("metalgrid3_normal-ogl")); + renderer.material.SetTexture("_METALLICGLOSSMAP", LoadTexture("metalgrid3_metallic")); + renderer.material.DisableKeyword("_SPECULAR_SETUP"); + + ApplySkybox(skyboxContainer); + + //RenderSettings.skybox.SetTexture("_BackTex", LoadTexture("back_galaxyfire")); + //RenderSettings.skybox.SetTexture("_DownTex", LoadTexture("down_galaxyfire")); + //RenderSettings.skybox.SetTexture("_FrontTex", LoadTexture("front_galaxyfire")); + //RenderSettings.skybox.SetTexture("_LeftTex", LoadTexture("left_galaxyfire")); + //RenderSettings.skybox.SetTexture("_RightTex", LoadTexture("right_galaxyfire")); + //RenderSettings.skybox.SetTexture("_UpTex", LoadTexture("up_galaxyfire")); + } + } +} diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs new file mode 100644 index 0000000..534681f --- /dev/null +++ b/Properties/Resources.Designer.cs @@ -0,0 +1,183 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace SpacemarketSimulator.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SpacemarketSimulator.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] back_galaxyfire1 { + get { + object obj = ResourceManager.GetObject("back_galaxyfire1", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] down_galaxyfire1 { + get { + object obj = ResourceManager.GetObject("down_galaxyfire1", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] front_galaxyfire1 { + get { + object obj = ResourceManager.GetObject("front_galaxyfire1", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] GalaxyFireMaterial { + get { + object obj = ResourceManager.GetObject("GalaxyFireMaterial", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] left_galaxyfire1 { + get { + object obj = ResourceManager.GetObject("left_galaxyfire1", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] metalgrid3_AO { + get { + object obj = ResourceManager.GetObject("metalgrid3_AO", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] metalgrid3_basecolor { + get { + object obj = ResourceManager.GetObject("metalgrid3_basecolor", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] metalgrid3_metallic { + get { + object obj = ResourceManager.GetObject("metalgrid3_metallic", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] metalgrid3_normal_ogl { + get { + object obj = ResourceManager.GetObject("metalgrid3_normal-ogl", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] metalgrid3_roughness { + get { + object obj = ResourceManager.GetObject("metalgrid3_roughness", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] right_galaxyfire1 { + get { + object obj = ResourceManager.GetObject("right_galaxyfire1", resourceCulture); + return ((byte[])(obj)); + } + } + + /// + /// Sucht eine lokalisierte Ressource vom Typ System.Byte[]. + /// + internal static byte[] up_galaxyfire1 { + get { + object obj = ResourceManager.GetObject("up_galaxyfire1", resourceCulture); + return ((byte[])(obj)); + } + } + } +} diff --git a/Properties/Resources.resx b/Properties/Resources.resx new file mode 100644 index 0000000..ec1ef8d --- /dev/null +++ b/Properties/Resources.resx @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\back_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\down_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\front_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\GalaxyFireMaterial.mat;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\left_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\metalgrid3_AO.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\metalgrid3_basecolor.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\metalgrid3_metallic.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\metalgrid3_normal-ogl.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\metalgrid3_roughness.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\right_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\up_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Resources/GalaxyFireMaterial.mat b/Resources/GalaxyFireMaterial.mat new file mode 100644 index 0000000..8fb2bef --- /dev/null +++ b/Resources/GalaxyFireMaterial.mat @@ -0,0 +1,59 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: GalaxyFireMaterial + m_Shader: {fileID: 104, guid: 0000000000000000f000000000000000, type: 0} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BackTex: + m_Texture: {fileID: 2800000, guid: 4bcc09e8d515d584b86b8ec5c19e8b3f, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DownTex: + m_Texture: {fileID: 2800000, guid: 03557cb833a29514e809fe3121c3b04d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FrontTex: + m_Texture: {fileID: 2800000, guid: f689d46fa2a6e254abad7c15b73c3f4a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _LeftTex: + m_Texture: {fileID: 2800000, guid: 34d6675f7f1177449a86d4df11c6bf49, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RightTex: + m_Texture: {fileID: 2800000, guid: e85bb475092c7bc40aa16839048d5339, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _UpTex: + m_Texture: {fileID: 2800000, guid: e5aaf30e569994d4ab3e49689e74b63f, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: [] + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + m_BuildTextureStacks: [] diff --git a/Resources/back_galaxyfire.png b/Resources/back_galaxyfire.png new file mode 100644 index 0000000..4871084 Binary files /dev/null and b/Resources/back_galaxyfire.png differ diff --git a/Resources/down_galaxyfire.png b/Resources/down_galaxyfire.png new file mode 100644 index 0000000..17ca449 Binary files /dev/null and b/Resources/down_galaxyfire.png differ diff --git a/Resources/front_galaxyfire.png b/Resources/front_galaxyfire.png new file mode 100644 index 0000000..445336d Binary files /dev/null and b/Resources/front_galaxyfire.png differ diff --git a/Resources/left_galaxyfire.png b/Resources/left_galaxyfire.png new file mode 100644 index 0000000..fb797ed Binary files /dev/null and b/Resources/left_galaxyfire.png differ diff --git a/Resources/metalgrid3_AO.png b/Resources/metalgrid3_AO.png new file mode 100644 index 0000000..009ff2c Binary files /dev/null and b/Resources/metalgrid3_AO.png differ diff --git a/Resources/metalgrid3_basecolor.png b/Resources/metalgrid3_basecolor.png new file mode 100644 index 0000000..641682b Binary files /dev/null and b/Resources/metalgrid3_basecolor.png differ diff --git a/Resources/metalgrid3_metallic.png b/Resources/metalgrid3_metallic.png new file mode 100644 index 0000000..ddc90c2 Binary files /dev/null and b/Resources/metalgrid3_metallic.png differ diff --git a/Resources/metalgrid3_normal-ogl.png b/Resources/metalgrid3_normal-ogl.png new file mode 100644 index 0000000..afe872f Binary files /dev/null and b/Resources/metalgrid3_normal-ogl.png differ diff --git a/Resources/metalgrid3_roughness.png b/Resources/metalgrid3_roughness.png new file mode 100644 index 0000000..81aa4ef Binary files /dev/null and b/Resources/metalgrid3_roughness.png differ diff --git a/Resources/right_galaxyfire.png b/Resources/right_galaxyfire.png new file mode 100644 index 0000000..259affb Binary files /dev/null and b/Resources/right_galaxyfire.png differ diff --git a/Resources/up_galaxyfire.png b/Resources/up_galaxyfire.png new file mode 100644 index 0000000..7a94981 Binary files /dev/null and b/Resources/up_galaxyfire.png differ diff --git a/SpacemarketSimulator.csproj b/SpacemarketSimulator.csproj new file mode 100644 index 0000000..727bfc8 --- /dev/null +++ b/SpacemarketSimulator.csproj @@ -0,0 +1,37 @@ + + + + netstandard2.1 + SpacemarketSimulator + My first plugin + 1.0.0 + true + latest + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + diff --git a/TransformDefiner.cs b/TransformDefiner.cs new file mode 100644 index 0000000..8cb4085 --- /dev/null +++ b/TransformDefiner.cs @@ -0,0 +1,38 @@ +using UnityEngine; + +namespace SpacemarketSimulator +{ + public class TransformDefiner : MonoBehaviour + { + public Vector3 position; + public Vector3 localPosition; + public Vector3 localScale; + public Vector3 eulerAngles; + + public void Update() + { + transform.localPosition = localPosition; + transform.localPosition = position + Plugin.Player.transform.position; + transform.localScale = localScale; + transform.eulerAngles = eulerAngles; + } + public static TransformDefiner AddToGameObject(GameObject go, Vector3 position, Vector3 localPosition, Vector3 localScale, Vector3 eulerAngles) + { + var td = go.AddComponent(); + td.position = position; + td.localPosition = localPosition; + td.localScale = localScale; + td.eulerAngles = eulerAngles; + return td; + } + public static TransformDefiner AddToGameObject(GameObject go) + { + var td = go.AddComponent(); + td.position = go.transform.position; + td.localPosition = go.transform.localPosition; + td.localScale = go.transform.localScale; + td.eulerAngles = go.transform.eulerAngles; + return td; + } + } +}