Skip to content

Instantly share code, notes, and snippets.

🦄
Making stuff =)

Dmitriy [focus] Yukhanov DmitriyYukhanov

🦄
Making stuff =)
Block or report user

Report or block DmitriyYukhanov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@DmitriyYukhanov
DmitriyYukhanov / ObjectTools.cs
Created Mar 21, 2017
Updated code to get a Unity object id.
View ObjectTools.cs
#define UNITY_5_PLUS
#if UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
#undef UNITY_5_PLUS
#endif
using UnityEngine;
using System.Reflection;
using UnityEditor;
namespace CodeStage.Maintainer.Tools
@DmitriyYukhanov
DmitriyYukhanov / dummy.cs
Created Jan 4, 2017
How to select asset in Project Browser without loading Asset.
View dummy.cs
// use to select asset at the Project Browser when you know path and asset
// has no objects inside, e.g. AssetDatabase.LoadMainAssetAtPath() returns null
// path - relative to Project folder, e.g. Assets/StrangeFile.asset
public static void SelectNonObjectFile(string path)
{
string guid = AssetDatabase.AssetPathToGUID(path);
// in perfect world, all reflection should be cached (including method delegate)
Type assetDatabaseType = typeof(AssetDatabase);
MethodInfo mi = assetDatabaseType.GetMethod("GetInstanceIDFromGUID", BindingFlags.NonPublic | BindingFlags.Static);
@DmitriyYukhanov
DmitriyYukhanov / WaitForSecondsUnscaled.cs
Last active Jan 5, 2017
Cacheable WaitForSecondsUnscaled CustomYieldInstruction example
View WaitForSecondsUnscaled.cs
/*
Copyright (c) 2016 Dmitriy Yukhanov
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
View ObjectTools.cs
#define UNITY_5_PLUS
#if UNITY_4_5 || UNITY_4_6 || UNITY_4_7 || UNITY_4_8 || UNITY_4_9
#undef UNITY_5_PLUS
#endif
using UnityEngine;
using System.Reflection;
using UnityEditor;
namespace CodeStage.Maintainer.Tools
You can’t perform that action at this time.