Initial commit

This commit is contained in:
pan.codes 2024-05-02 18:50:57 +02:00
commit a430310324
20 changed files with 1023 additions and 0 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto

398
.gitignore vendored Normal file
View file

@ -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

6
NuGet.Config Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="BepInEx" value="https://nuget.bepinex.dev/v3/index.json" />
</packageSources>
</configuration>

143
Plugin.cs Normal file
View file

@ -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<Shader>())
{
Logger.LogInfo("Available shader: " + shader.name);
}
SceneManager.sceneLoaded += SceneManager_sceneLoaded;
}
private Dictionary<string, Texture2D> 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<MeshRenderer>();
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<MeshRenderer>();
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"));
}
}
}

183
Properties/Resources.Designer.cs generated Normal file
View file

@ -0,0 +1,183 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SpacemarketSimulator.Properties {
using System;
/// <summary>
/// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw.
/// </summary>
// 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() {
}
/// <summary>
/// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird.
/// </summary>
[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;
}
}
/// <summary>
/// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle
/// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] back_galaxyfire1 {
get {
object obj = ResourceManager.GetObject("back_galaxyfire1", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] down_galaxyfire1 {
get {
object obj = ResourceManager.GetObject("down_galaxyfire1", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] front_galaxyfire1 {
get {
object obj = ResourceManager.GetObject("front_galaxyfire1", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] GalaxyFireMaterial {
get {
object obj = ResourceManager.GetObject("GalaxyFireMaterial", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] left_galaxyfire1 {
get {
object obj = ResourceManager.GetObject("left_galaxyfire1", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] metalgrid3_AO {
get {
object obj = ResourceManager.GetObject("metalgrid3_AO", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] metalgrid3_basecolor {
get {
object obj = ResourceManager.GetObject("metalgrid3_basecolor", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] metalgrid3_metallic {
get {
object obj = ResourceManager.GetObject("metalgrid3_metallic", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] metalgrid3_normal_ogl {
get {
object obj = ResourceManager.GetObject("metalgrid3_normal-ogl", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] metalgrid3_roughness {
get {
object obj = ResourceManager.GetObject("metalgrid3_roughness", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] right_galaxyfire1 {
get {
object obj = ResourceManager.GetObject("right_galaxyfire1", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Sucht eine lokalisierte Ressource vom Typ System.Byte[].
/// </summary>
internal static byte[] up_galaxyfire1 {
get {
object obj = ResourceManager.GetObject("up_galaxyfire1", resourceCulture);
return ((byte[])(obj));
}
}
}
}

157
Properties/Resources.resx Normal file
View file

@ -0,0 +1,157 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="back_galaxyfire1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\back_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="down_galaxyfire1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\down_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="front_galaxyfire1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\front_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="GalaxyFireMaterial" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GalaxyFireMaterial.mat;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="left_galaxyfire1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\left_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="metalgrid3_AO" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\metalgrid3_AO.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="metalgrid3_basecolor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\metalgrid3_basecolor.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="metalgrid3_metallic" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\metalgrid3_metallic.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="metalgrid3_normal-ogl" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\metalgrid3_normal-ogl.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="metalgrid3_roughness" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\metalgrid3_roughness.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="right_galaxyfire1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\right_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="up_galaxyfire1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\up_galaxyfire.png;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>

View file

@ -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: []

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 KiB

BIN
Resources/metalgrid3_AO.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 KiB

BIN
Resources/up_galaxyfire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 KiB

View file

@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<AssemblyName>SpacemarketSimulator</AssemblyName>
<Description>My first plugin</Description>
<Version>1.0.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BepInEx.Analyzers" Version="1.*" PrivateAssets="all" />
<PackageReference Include="BepInEx.Core" Version="5.*" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.*" />
<PackageReference Include="UnityEngine.Modules" Version="2021.3.3" IncludeAssets="compile" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework.TrimEnd(`0123456789`))' == 'net'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

38
TransformDefiner.cs Normal file
View file

@ -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<TransformDefiner>();
td.position = position;
td.localPosition = localPosition;
td.localScale = localScale;
td.eulerAngles = eulerAngles;
return td;
}
public static TransformDefiner AddToGameObject(GameObject go)
{
var td = go.AddComponent<TransformDefiner>();
td.position = go.transform.position;
td.localPosition = go.transform.localPosition;
td.localScale = go.transform.localScale;
td.eulerAngles = go.transform.eulerAngles;
return td;
}
}
}