Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / Tooltip.cs
Created March 19, 2025 17:33
Move Screenspace UI (ugui) element near Mouse Position
tooltipRect.position = Input.mousePosition + (Vector3.right+Vector3.up) * 20;
// css waterdrop https://codepen.io/antoniasymeonidou/pen/QWqpoMJ
<div class='center'>
<div class='blob'></div></div>
body {
background: #e0e0e0;
}
.center {
@unitycoder
unitycoder / DamageNumberSpawner.cs
Created March 2, 2025 15:10 — forked from adammyhre/DamageNumberSpawner.cs
World Space UI Toolkit
using PrimeTween;
using UnityEngine;
using UnityEngine.Pool;
using UnityUtils;
public class DamageNumberSpawner : MonoBehaviour {
[SerializeField] WorldSpaceUIDocument uiDocumentPrefab;
[SerializeField] float positionRandomness = 0.2f;
IObjectPool<WorldSpaceUIDocument> uiDocumentPool;
@unitycoder
unitycoder / ListResolutions.cs
Created February 21, 2025 09:46
c# get available screen resolutions
// https://stackoverflow.com/a/744609/5452781
using System;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace ListResolutions
{
@unitycoder
unitycoder / VideoSupportPlugin.java
Created February 21, 2025 09:43 — forked from asus4/VideoSupportPlugin.java
Check supported resolution from unity
package asus4.videosupportedplugin;
import android.media.MediaCodecInfo;
import android.media.MediaCodecList;
/**
* Created by ibu on 2017/03/12.
*/
public final class VideoSupportedPlugin {
@unitycoder
unitycoder / Unity Firebase Push Notifications.md
Last active February 15, 2025 21:35
Unity Firebase Push Notifications

GUIDE

ERRORS

Assembly 'Assets/ExternalDependencyManager/Editor/1.2.185/Google.IOSResolver.dll' will not be loaded due to errors..

Install IOS module to your Unity editor.

Error (active) CS0234 The type or namespace name 'Messaging' does not exist in the namespace 'Firebase' (are you missing an assembly reference?) Assembly-CSharp Assets\Scripts\PushNotifications.cs 23

@unitycoder
unitycoder / validator.bat
Last active February 13, 2025 15:52
Unity Asset Store Validator for Missing Namespaces or *unity* in namespace name
// https://gist.github.com/unitycoder/6b796a2b1392b299854b24cdcd56d305
// run this in your Assets/ folder
@echo off
echo Scanning for C# files without a namespace or with a namespace containing "unity"...
echo.
for /r %%f in (*.cs) do (
rem Check if the file contains any "namespace" keyword
findstr /i "namespace" "%%f" >nul
@unitycoder
unitycoder / TMP_InputField.cs
Created February 13, 2025 07:39 — forked from nikescar1/TMP_InputField.cs
Since TMP_InputField is essentially unusable with gamepad and keyboard navigation, I upgraded them to work better (don't start editing on select and added OnFocus event)
//#define TMP_DEBUG_MODE
using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Text;
using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.UI;
@unitycoder
unitycoder / TransformEditor.cs
Created February 12, 2025 12:54 — forked from GhatSmith/TransformEditor.cs
Custom inspector for Transform component. Add buttons to reset, copy, paste Transform values. Add context menu to round or truncate values.
using UnityEngine;
using UnityEditor;
namespace OddTales.Framework.Core.EditorExtension
{
/// <summary>
/// Custom inspector for Transform component. Using only DrawDefaultInspector would give different display.
/// Script based on Unity wiki implementation : https://wiki.unity3d.com/index.php/TransformInspector
/// Buttons to reset, copy, paste Transform values.