GlobalGameJame/Library/PackageCache/com.unity.timeline@1.2.10/Editor/Utilities/ObjectExtension.cs
JonatanRek bea2dce063 Initial
test
2020-01-31 16:10:04 +01:00

29 lines
641 B
C#

using UnityEngine;
using UnityEditor;
namespace UnityEditor.Timeline
{
static class ObjectExtension
{
public static bool IsSceneObject(this Object obj)
{
if (obj == null)
return false;
bool isSceneType = obj is GameObject || obj is Component;
if (!isSceneType)
return false;
return !PrefabUtility.IsPartOfPrefabAsset(obj);
}
public static bool IsPrefab(this Object obj)
{
if (obj == null)
return false;
return PrefabUtility.IsPartOfPrefabAsset(obj);
}
}
}