Skip to content

Instantly share code, notes, and snippets.

View unitycoder's full-sized avatar
‏‏‎

mika unitycoder

‏‏‎
View GitHub Profile
@unitycoder
unitycoder / TSVImporter.cs
Created April 7, 2024 08:15
import non .txt file as TextAsset with OnImportAsset
// https://forum.unity.com/threads/tsv-file-as-textassets.495244/#post-9754270
using System.IO;
using UnityEditor;
 
using UnityEngine;
 
[UnityEditor.AssetImporters.ScriptedImporter(1, "tsv")]
public class TSVImporter : UnityEditor.AssetImporters.ScriptedImporter
{
    public override void OnImportAsset(UnityEditor.AssetImporters.AssetImportContext ctx)
@unitycoder
unitycoder / Squid Proxy Notes.md
Created April 2, 2024 13:09
Squid Proxy Notes

Cannot connect from IRC client

You need to allow CONNECT, from that port, default is this line (which is for 443 port only)
http_access deny CONNECT !SSL_ports

@unitycoder
unitycoder / PowerOfTwo.cs
Created March 15, 2024 12:22
NextPowerOfTwo, ClosestPowerOfTwo, IsPowerOfTwo
// https://github.com/Unity-Technologies/UnityCsReference/blob/master/Runtime/Export/Math/Mathf.cs
public static int NextPowerOfTwo(int value)
{
value -= 1;
value |= value >> 16;
value |= value >> 8;
value |= value >> 4;
value |= value >> 2;
value |= value >> 1;
return value + 1;
@unitycoder
unitycoder / uwp-cloudbuild.md
Created March 14, 2024 17:23
code sign windows application
// https://forum.unity.com/threads/codesign-a-windows-build.1558505/
$password = ConvertTo-SecureString -String \"#{password}\" -Force -AsPlainText
 
$subject_name = (Get-PfxData -FilePath "$filePath" -Password $password | Select-Object -ExpandProperty EndEntityCertificates | Select-Object -ExpandProperty SubjectName).Name
 
$subject_name = $subject_name -replace 'CN=', ''
Import-PfxCertificate -FilePath $filePath -CertStoreLocation Cert:\\LocalMachine\\My -Password $password
 
& signtool.exe sign /a /sm /n $subject_name /fd SHA256 "$fileToSign"
@unitycoder
unitycoder / PhotoshopBlendModes
Created March 13, 2024 18:58 — forked from miketucker/PhotoshopBlendModes
photoshop blending modes
/*
** Copyright (c) 2012, Romain Dura romain@shazbits.com
**
** Permission to use, copy, modify, and/or distribute this software for any
** purpose with or without fee is hereby granted, provided that the above
** copyright notice and this permission notice appear in all copies.
**
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
@unitycoder
unitycoder / emojis.md
Last active May 6, 2024 08:04
useful UTF8 Emojis Icons Symbols
@unitycoder
unitycoder / TestAgent.cs
Created March 9, 2024 20:58
NavMesh Agent sample
using UnityEngine;
using UnityEngine.AI;
public class TestAgent : MonoBehaviour
{
public Transform target;
NavMeshAgent agent;
void Start()
{
@unitycoder
unitycoder / SelectionBase.cs
Created March 7, 2024 10:06
How to I force the selection of a parent when a child is selected in the Scene View
// https://discussions.unity.com/t/how-to-i-force-the-selection-of-a-parent-when-a-child-is-selected-in-the-editor/36493
// other manual option is to lock children with L key: https://www.reddit.com/r/Unity3D/comments/129oc5n/scene_view_select_parent_solved_thank_the_maker/
// attach into root gameobject, to make it always select root instead of children
using UnityEngine;
[SelectionBase]
public class SelectionBase : MonoBehaviour
{
}
@unitycoder
unitycoder / package.json
Last active March 7, 2024 08:56
Unity Hub> Custom Unity Template package.json with VIDEO and CUSTOM CSS
{
"name": "com.unitycoder.template.fun",
"displayName": "Best Template 🍔™",
"version": "1.0.0",
"type": "template",
"unity": "2022.3",
"description": "Some description here.. <video width='320' height='240' autoplay style=''><source src='https://cdn.mtdv.me/video/rick.mp4' type='video/mp4'></video><style>.template-preview__image{display:none !important;}</style>",
"dependencies": {},
"repository": {
"type": "git",
@unitycoder
unitycoder / yahoo-login-issue.md
Created March 5, 2024 09:24
yahoo mail login broken in Desktop, doesnt login

Solution 1

Assign some DNS server like cloudflare: 1.1.1.1 or 1.0.0.1 or google: 8.8.8.8 and 8.8.4.4