Skip to content

Instantly share code, notes, and snippets.

View dimmduh's full-sized avatar
🎮
Learning Unity

Dmitrii Dukhnich dimmduh

🎮
Learning Unity
View GitHub Profile
@jeffvella
jeffvella / UnityDrawStringDebugText
Created August 2, 2018 13:34
Drawing Debug text with background in Unity
public static void DrawString(string text, Vector3 worldPos, Color? textColor = null, Color? backColor = null)
{
UnityEditor.Handles.BeginGUI();
var restoreTextColor = GUI.color;
var restoreBackColor = GUI.backgroundColor;
GUI.color = textColor ?? Color.white;
GUI.backgroundColor = backColor ?? Color.black;
var view = UnityEditor.SceneView.currentDrawingSceneView;
@LotteMakesStuff
LotteMakesStuff / PackageManagerExtentionExample.cs
Last active July 23, 2024 03:25
As of v1.9.3, Unity has added a simple extention API to the PackageManager UI. This small example shows you how to implment it and add a new window to the package manager. Note: you will need to change to the Staging package repository as time of writing. This code needs to go in an Editor folder
using System.Linq;
using UnityEditor;
using UnityEditor.PackageManager.UI;
using UnityEngine;
using UnityEngine.Experimental.UIElements;
using UnityEngine.Experimental.UIElements.StyleEnums;
using PackageInfo = UnityEditor.PackageManager.PackageInfo;
[InitializeOnLoad]
public class PackageManagerExtentionExample : IPackageManagerExtension
@nicoplv
nicoplv / DebugPanel.cs
Created March 13, 2018 10:22
Debug Panel for Unity - To debug your variables more easily
using System.Collections.Generic;
using UnityEngine;
namespace SmartUnity.Debugs
{
public class DebugPanel
{
#region Variables
private static DebugPanel debugPanel;
@LotteMakesStuff
LotteMakesStuff / 1.md
Last active January 2, 2025 21:54
UPM: How to make a custom package

UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!


Todo

  • Modify the project manifest
  • Make a package manifest
  • Package the manifest up with some test code
  • Try it out in Unity!

@Dreezn
Dreezn / ClipStartEndInMixer.cs
Last active August 12, 2024 07:36
Getting the Clip Start End Times through to the mixer
/* 1 - Overriding CreateTrackMixer in the CustomTransformationTrack class,
getting the start & end times for each clip, and passing them to the custom clip class. */
//[Omitted...]
public class CustomTransformationTrack : TrackAsset
{
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
{
foreach (var clip in GetClips())
{
@erlangparasu
erlangparasu / NetworkUtilsAcceptSelfSignedSslCert.java
Last active December 6, 2020 10:59
OkHttp Accept Self-signed SSL Certificate
// package ... ;
/**
* Copyright (C) 2014 Square, Inc.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
@keithmorris
keithmorris / drive-format-ubuntu.md
Last active May 1, 2025 14:39
Partition, format, and mount a drive on Ubuntu
@zhenlinyang
zhenlinyang / AndroidSignCheck.cs
Created December 6, 2016 02:48
AndroidSignCheck
using UnityEngine;
public static class AndroidSignCheck
{
private const string c_PackageName = "com.yangzhenlin.unitydemo";
public static byte[] GetSignature()
{
//Player = new UnityPlayer();
AndroidJavaClass Player = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
server {
listen 80 default_server deferred;
server_name what-shong.com;
root /root/what-song-frontend/current;
access_log /root/what-song-frontend/current/nginx.access.log;
error_log /root/what-song-frontend/current/nginx.error.log info;
location / {
proxy_pass http://104.156.56.109:3000;
@dddnuts
dddnuts / Fastfile
Created June 4, 2016 10:39
Build ipa from Unity project with fastlane
fastlane_version "1.94.0"
default_platform :ios
platform :ios do
desc "Run Unity Editor tests"
lane :test_unit do
unity(
run_editor_tests: true
)