Exemplo n.º 1
0
        private void TryAddReference(Object asset)
        {
            switch (asset)
            {
            case GameObject gameObject:
                if (!PrefabReferences.Contains(gameObject))
                {
                    PrefabReferences.Add(gameObject);
                }
                break;

            case ScriptableObject scriptableObject:
                if (!ScriptableObjectReferences.Contains(scriptableObject))
                {
                    ScriptableObjectReferences.Add(scriptableObject);
                }
                break;

            case MonoBehaviour monoBehaviour:
                if (!SceneReferences.Contains(monoBehaviour))
                {
                    SceneReferences.Add(monoBehaviour);
                }
                break;

            default:
                Debug.LogErrorFormat($"Unexpected Type. Found Object [{asset}], is {asset.GetType()} with base Type {asset.GetType().BaseType}.");
                break;
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Awake this instance.
 /// </summary>
 protected virtual void Awake()
 {
     m_sceneReferences = this.GetComponent <SceneReferences>();
 }