Skip to content

Instantly share code, notes, and snippets.

View restush's full-sized avatar
🎯
Focusing

Restu Syibul Huda restush

🎯
Focusing
  • AmoyFeels
  • Indonesia
View GitHub Profile
@restush
restush / settings.json
Created October 3, 2024 01:27
Search Files Settings for App UI - Unity
{
"search.showLineNumbers": true,
"search.useIgnoreFiles": false,
"search.exclude": {
"**/*.uxml": true,
"**/*.asmdef": true,
"**/*.playable": true,
"**/*.asset": true,
"**/*.mat": true,
"**/*.meta": true,
@restush
restush / SceneListEditorWindow.cs
Last active September 30, 2024 11:37
Scene List & Pins - Scene Dasboard, for quick access your favorite scenes. Made with UI Toolkit.
/// https://gist.github.com/restush/849b5662dd82b7eb68ee78950e1a8033
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using UnityEngine.UIElements;
@restush
restush / FindMissingEditor.cs
Last active August 17, 2024 18:58 — forked from to-osaki/FindMissingEditor.cs
Unity Find missing references
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.UIElements;
using UnityEngine;
using UnityEngine.UIElements;
public class FindMissingEditor : EditorWindow
{
private float _progress = 0f;
private bool _canceled;
@restush
restush / Order Convention Writng C# Class.cs
Last active October 23, 2023 01:12
A correct way to write C# aka order convention of writing a C# class.
public class MyClass
{
// Nested classes, structs, enums
public class PublicNestedClass { }
public struct PublicNestedStruct { }
public enum PublicNestedEnum { A, B, C }
private class PrivateNestedClass { }
private struct PrivateNestedStruct { }
private enum PrivateNestedEnum { A, B, C }
@restush
restush / CustomTime.cs
Last active May 19, 2024 15:06
CustomTime for Naninovel in Unity
/// <summary> Custom Unity Time based on <see cref="System.Diagnostics.Stopwatch"/> </summary>
public class CustomTime : ITime
{
public float TimeScale { get; set; }
public float Time { get; private set; }
public float DeltaTime { get; private set; }
public float UnscaledTime { get; private set; }
public float UnscaledDeltaTime { get; private set; }
public int FrameCount { get; private set; }
@restush
restush / UniTask-AllowSceneActivation.cs
Last active August 14, 2023 11:39
UniTask Unity Cheat Sheet
/// Example Usage
{
...
var operation = await LoadSceneOperation(nameOfScene, (progress)=>slider.value = progress);
...
...
operation.allowSceneActivation = true;
...
@restush
restush / ICircleTarget.cs
Last active June 29, 2023 14:42
Get target position in form of Circular / Circle position. So multiple agents that are following target, will try circling target. This prevent agents colliding with each other because wants to go to the same position.
using System.Collections.Generic;
using UnityEngine;
///<summary> Attach this script on Monobehaviour class </summary>
public interface ICircleTarget
{
/// <summary> Circle radius around target </summary>
float RadiusAroundTarget { get; set; }
/// <summary> Contain objects that following this target </summary>
List<Transform> CircleObjects { get; set; }
@restush
restush / SimpleDateTime.cs
Last active June 9, 2023 23:30
Simple serializable System.DateTime and Time Machine for Unity Engine.
using System;
using UnityEngine;
/// <summary>
/// Simple Date Time based on <see cref="System.DateTime"/>.
/// <example>
/// <br/><br/>
/// Usage 1:
/// <code>
/// var simpleDateTime = new SimpleDateTime(DateTime.Now);
@restush
restush / Initializer.cs
Last active June 9, 2023 22:29
Unity Google Play Asset Delivery
using System;
using System.Collections;
using System.Linq;
using UnityEngine;
using UnityEngine.Android;
using UnityEngine.Networking;
using UnityEngine.UI;
public class Initializer : MonoBehaviour
{