Comments (4)
It is safe...
This is just an editor display issue, the data is in tact. What is happening is the inspector is assuming that it is resolving an asset reference rather than a scene object reference.
It is simple enough to make a custom editor for the inspector or to use a property drawer to get your display back for debugging. If you do not want to edit the data in the inspector, you can simply draw EditorGUI.ObjectField with allowSceneObjects true. If you do want it to be editable in the inspector it can get more complicated to do it genericly.
from unite2017.
I think this is due to the Scriptable object trying to reference a Gameobject, which would result in a type mismatch. I believe that the way Ryan implements this is a very clever way enable a reference to the gameobject.
For example in his ThingDisabler Script (which is a Monobehaviour) he can do this:
Set.Items[i].gameObject.SetActive(false);
which allows his to reference the "Set" and find gameobjects then delete them.
Really clever, not sure if I'm answering this correctly however.
from unite2017.
Some more proof to the previous answer.
If we change RuntimeSet to:
public abstract class RuntimeSet<T> : ScriptableObject
{
public List<string> gameobjectNames = new List<string>();
public List<T> Items = new List<T>();
public void Add(T thing, string name)
{
if (!Items.Contains(thing))
Items.Add(thing);
gameobjectNames.Add(name);
}
public void Remove(T thing, string name)
{
if (Items.Contains(thing))
Items.Remove(thing);
gameobjectNames.Remove(name);
}
}
and change Thing.cs to:
public class Thing : MonoBehaviour
{
public ThingRuntimeSet RuntimeSet;
private void OnEnable()
{
RuntimeSet.Add(this, this.name);
}
private void OnDisable()
{
RuntimeSet.Remove(this, this.name);
}
}
we can see this is actually working.
from unite2017.
Yeah, i know it's working.
Assets can reference scene objects until new scene is loaded.
My question was: Can i ignore that "Type mismatch" labels and be sure nothing will suddenly break
from unite2017.
Related Issues (11)
- Add a license HOT 2
- #ifdef UNITY_EDITOR on serialized property HOT 1
- Setter for Value property in FloatReference HOT 3
- FloatReferenceDrawer no longer works HOT 4
- Inventory Demo HOT 3
- Handling multiple instances of objects (ie PlayerHealth, but multiple player's) HOT 3
- Persistence (saving data) HOT 1
- Wouldn't source control be spammed with unnecessary changes caused by persistant scriptable assets being modified at run time? HOT 1
- ScriptableObjectsEvents on build, Android not working. HOT 4
- Event send an arg HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unite2017.