Skip to content

Instantly share code, notes, and snippets.

@HolyFot
HolyFot / ClientPackets.cs
Created Oct 6, 2020
Starter Forge Client & Server Stuff
View ClientPackets.cs
using BeardedManStudios;
using BeardedManStudios.Forge.Networking;
using BeardedManStudios.Forge.Networking.Unity;
using BeardedManStudios.Forge.Networking.Lobby;
using BeardedManStudios.Forge.Networking.Frame;
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
@HolyFot
HolyFot / FPSInfo.cs
Created Sep 14, 2020
FPS Counter + Hardware Info
View FPSInfo.cs
//Displays: Accurate FPS Counter + Hardware Info
//Author: HolyFot
//License: CC0
using UnityEngine;
using System;
using System.Collections;
public class FPSInfo : MonoBehaviour
{
public KeyCode openFPS = KeyCode.P;
@HolyFot
HolyFot / Door.cs
Last active Oct 7, 2020
Unity Door Script with Pivot
View Door.cs
//Perfect Door/Chest/DrawBridge Animation Script
//Author: HolyFot
//License: CC0
using UnityEngine;
using System.Collections;
public class Door : MonoBehaviour
{
[SerializeField] public GameObject doorObj;
[SerializeField] public GameObject pivot;
View NightLight.cs
using UnityEngine;
using System.Collections.Generic;
public class NightLight : MonoBehaviour
{
[SerializeField] public List<GameObject> objects;
public bool isNight = false;
private void Awake()
{
@HolyFot
HolyFot / CubeBuilding.cs
Last active Aug 23, 2020
Old Voxel Minecraft Cube System C# Unity
View CubeBuilding.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using Ist;
using BeardedManStudios.Network;
public class CubeBuilding : MonoBehaviour
{
public enum DataTransferMode
@HolyFot
HolyFot / SimpleLOD.cs
Created Jul 17, 2020
SimpleLOD C# Unity
View SimpleLOD.cs
//Made by: HolyFot
//License: CC0 - https://creativecommons.org/share-your-work/public-domain/cc0/
//For MeshRenderers (Basic Objects). Quickly swaps the mesh/materials for LODs, replacement for LOD Group.
//This is a roughdraft, but works.
using UnityEngine;
using System;
using System.Collections.Generic;
//[ExecuteInEditMode]
public class SimpleLOD : MonoBehaviour
View Example.cs
//Example
public void AddFriend()
{
//Show Input Window
if (inputWindow != null)
{
inputWindow.onOkClickCall += AddFriend2;
inputWindow.ShowInputWindow("Username to add as friend:");
}
}
@HolyFot
HolyFot / Example.cs
Created Jul 17, 2020
Re-usable YesNo Window C# Unity
View Example.cs
//Example
public YesNoWindow yesNoWindow;
public void ExitGame()
{
if (yesNoWindow != null)
{
yesNoWindow.onYesClickCall += ExitGame2;
yesNoWindow.ShowYesNo("Are you sure you wish to quit the game?");
}
@HolyFot
HolyFot / CharacterLOD.cs
Created Jul 17, 2020
Non-invasive Character/NPC LOD Script C# Unity
View CharacterLOD.cs
//Made by: HolyFot
//License: CC0 - https://creativecommons.org/share-your-work/public-domain/cc0/
//For SkinneMeshRenderers (Characters/NPCs/Etc). This script was made to just swap the mesh/materials for LODs, since Unity's LOD Group to change the entire object which isn't ideal for weapons/armor/objects.
//This is a roughdraft, but works.
using UnityEngine;
using System;
using System.Collections.Generic;
//[ExecuteInEditMode]
public class CharacterLOD : MonoBehaviour
@HolyFot
HolyFot / Example.cs
Created Jul 15, 2020
Map/Scene Truly Loaded Detector C# Unity
View Example.cs
//EXAMPLE USAGE:
void OnEnable()
{
if (MapLoadDetector.Instance != null)
MapLoadDetector.Instance.onMap1LoadedCall += OnMapLoaded;
}
void OnDisable()
{
if (MapLoadDetector.Instance != null)