com.Indigocoder.SubLibrary 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package com.Indigocoder.SubLibrary --version 1.1.0                
NuGet\Install-Package com.Indigocoder.SubLibrary -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="com.Indigocoder.SubLibrary" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add com.Indigocoder.SubLibrary --version 1.1.0                
#r "nuget: com.Indigocoder.SubLibrary, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install com.Indigocoder.SubLibrary as a Cake Addin
#addin nuget:?package=com.Indigocoder.SubLibrary&version=1.1.0

// Install com.Indigocoder.SubLibrary as a Cake Tool
#tool nuget:?package=com.Indigocoder.SubLibrary&version=1.1.0                

Using the Library

This library is designed for implementing submarines in mods for the game Subnautica. If that is not what you're doing, then this package is not for you.

To use the library, you will need to add it to your Unity project that is using Thunderkit.

The components you need will depend on the sub you are making, but some of the more versatile components are the Spawn____ ones, which spawn and assign elements of the Cyclops to your sub.

Different Components

There are some components in this library that replace ones that you might find on subs such as the Cyclops. One of the most notable ones is the ModdedSubFire replacing SubFire.

This is to provide more flexibility and to remove stuff like the use of enums, which limit expandability.

Save System

This library also comes with a custom save system for your subs. Simply add the SubSerializationManager to your prefab root, and then create a class for your save data extending either ModuleDataClass or BaseSubDataClass.

Then in the Save Data Type Class Name field on the manager put in the full Type of your save data class (I.e. Chameleon.SaveData.ChameleonSaveDataClass).

The manager will also call any ISaveDataListener or ILateSaveDataListeners on save and load. These methods provide a BaseSubDataClass and you will need to cast it to your data class.

If the data isn't your data class (I.e. the cast is null) it means your sub doesn't have save data yet. I recommend making an extension method for BaseSubDataClass which ensures that your data isn't null and casts it to your data type.

Miscellaneous

Many fields accessible on components in this library have tooltips on them. If you're ever confused about what something does try hovering over its name in Unity to see if it has any extra info there.

When forking/modifying the repo:

You will need to go into the Configuration.targets file and change the CommonDir to the path to your Steam library folder so that the project builds correctly.

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.4.1 45 11/20/2024
1.3.0 51 10/7/2024
1.2.0 65 9/14/2024
1.1.0 89 8/10/2024
1.0.1 66 8/9/2024
1.0.0 43 8/5/2024

Added sky manager
Added proximity sensors system
Fixed floodlight marker not being able to be added as a component
Fixed OnTakeFireDamage call not reaching the HUD manager