Skip to content

Instantly share code, notes, and snippets.

@HajiyevEl
HajiyevEl / SafeTask.cs
Created July 9, 2023 12:28 — forked from marcospgp/SafeTask.cs
Cancel async tasks in Unity upon exiting play mode
using System;
using System.Threading;
using System.Threading.Tasks;
namespace MarcosPereira.UnityUtilities {
/// <summary>
/// A replacement for `Task.Run()` that cancels tasks when exiting play
/// mode, which Unity doesn't do by default.
/// Also registers a UnobservedTaskException handler to prevent exceptions
/// from being swallowed in both Tasks and SafeTasks, when these are
@HajiyevEl
HajiyevEl / CubemapTextureBuilder.cs
Created December 6, 2022 21:32 — forked from RemyUnity/CubemapTextureBuilder.cs
Unity utility to convert 6 texture to a single cubemap texture
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Linq;
using System.IO;
public class CubemapTextureBuilder : EditorWindow
{
[MenuItem("Tools/Cubemap Builder")]
@HajiyevEl
HajiyevEl / SkinnedMeshObjectPreviewExample.cs
Created October 7, 2022 10:07 — forked from radiatoryang/SkinnedMeshObjectPreviewExample.cs
An example of a custom ObjectPreview rendering out a SkinnedMesh for Unity Editor C#... I used it for facial expressions and blendshape editing, you might want to use it for something else. I hereby place it under MIT License. Full write-up here: http://www.blog.radiator.debacle.us/2016/06/working-with-custom-objectpreviews-and.html
using UnityEngine;
using UnityEditor;
using System;
using System.Collections;
[CustomPreview(typeof(YourCustomScriptableObject))] // THIS IS VERY IMPORTANT, this is so the editor knows what this is supposed to be previewing at all
public class SkinnedMeshObjectPreviewExample : ObjectPreview {
PreviewRenderUtility m_PreviewUtility;
@HajiyevEl
HajiyevEl / SkinnedMeshCombiner.cs
Created October 7, 2022 10:06 — forked from radiatoryang/SkinnedMeshCombiner.cs
example code for combining SkinnedMeshRenderers at runtime (for optimization reasons usually), which I use in my games for Mixamo Fuse models specifically... PLEASE DON'T ASK ME FOR HELP WITH THIS, this is more for learning purposes, and it's not really an easy-to-use Asset Store thing? also I have a lot of weird hacks specific for my uses... ag…
// this code is under MIT License, by Robert Yang + others (credits in comments)
// a lot of this is based on http://wiki.unity3d.com/index.php?title=SkinnedMeshCombiner
// but I removed the atlasing stuff because I don't need it
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;