Firstborn/Library/PackageCache/com.unity.timeline@1.7.1/Editor/Utilities/ObjectExtension.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05: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);
}
}
}