You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
641 B
28 lines
641 B
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); |
|
} |
|
} |
|
}
|
|
|