Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / Pool.cs
Created November 12, 2024 12:37
simple object pooling class
// source https://github.com/AlCh3mi/GameJamToolKit/blob/main/GameJamToolkit/ObjectPooling/Pool.cs
using System;
using UnityEngine;
using UnityEngine.Pool;
namespace UnityLibrary.ObjectPooling
{
public abstract class Pool<T> : MonoBehaviour where T : MonoBehaviour
{
@unitycoder
unitycoder / enemy.cs
Created November 10, 2024 15:08
Projectile motion Unity 3D to always make a Hit to moving object
// https://web.archive.org/web/20150428033712/http://lexiconhub.tk/index/game-programming/projectile-motion-unity-3d/
using UnityEngine;
using System.Collections;
public class enemy : MonoBehaviour
{
public float MinSpeed;
public float MaxSpeed;
public float currentSpeed;
private float x, y, z;
@unitycoder
unitycoder / hls.sh
Created November 8, 2024 21:59 — forked from stenuto/hls.sh
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@unitycoder
unitycoder / CursorLock.cs
Created November 8, 2024 12:24 — forked from Thaina/CursorLock.cs
Actual pointer lock value in unity webgl and windows editor
using System.Collections;
using System.Collections.Generic;
#if UNITY_EDITOR_WIN || UNITY_WEBGL
using System.Runtime.InteropServices;
#endif
using UnityEngine;
public static class CursorLock
@unitycoder
unitycoder / DebugUtilities.cs
Created November 8, 2024 11:14
Debug draw sphere box script
// https://discussions.unity.com/t/debug-draw-sphere-script/1550055
using System.Collections;
using UnityEngine;
public static class DebugUtilities
{
/// <summary>
/// Draw primitive forms like capsule, cubes ecc... for a N time in a location.
/// (similar to Debug.DrawRay)
/// </summary>
@unitycoder
unitycoder / MiniJSON.cs
Created November 7, 2024 18:14
miniJSON JSON parser
// https://github.com/unitycoder/Unity3DUtil/blob/master/u3d/Assets/Core/MiniJSON.cs
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
@unitycoder
unitycoder / nerfstudio installation windows 10.md
Last active November 8, 2024 20:27
nerfstudio installation windows 10

nerfstudio installation windows 10

  • https://docs.nerf.studio/quickstart/installation.html
  • install/upgrade Anaconda for windows (old versions wont work)
  • vs install those MSVC 143 packages (i installed for 2019 and 2022)
  • // SKIP: use Everything ( https://www.voidtools.com/) to find vcvars64.bat
  • // SKIP: i had it at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build , run from commandline: vcvars64.bat **I DIDNT DO THIS later
  • run anaconda prompt
  • make nerfstudio folder, go there
  • // SKIP: run "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
@unitycoder
unitycoder / CommentComponent.cs
Created November 4, 2024 21:03 — forked from yasirkula/CommentComponent.cs
Adding comments to Inspector via a component in Unity
#if UNITY_EDITOR
using UnityEditor;
#endif
using UnityEngine;
[AddComponentMenu("Comment")]
public class CommentComponent : MonoBehaviour
{
#if UNITY_EDITOR
[SerializeField]