A game about forced loneliness, made by TACStudios
at master 28 lines 641 B view raw
1using UnityEngine; 2using UnityEditor; 3 4namespace UnityEditor.Timeline 5{ 6 static class ObjectExtension 7 { 8 public static bool IsSceneObject(this Object obj) 9 { 10 if (obj == null) 11 return false; 12 13 bool isSceneType = obj is GameObject || obj is Component; 14 if (!isSceneType) 15 return false; 16 17 return !PrefabUtility.IsPartOfPrefabAsset(obj); 18 } 19 20 public static bool IsPrefab(this Object obj) 21 { 22 if (obj == null) 23 return false; 24 25 return PrefabUtility.IsPartOfPrefabAsset(obj); 26 } 27 } 28}