I want to be able to drag & drop variables (floats, integers, maybe even classes) in the inspector view. So that if I have FirstScript
and SecondScript
I could easily drag & drop variables between them so that they can change each others’ data. I need this to create more modular workflow.
I know that ScriptableObjects allow similar functionality but I need to create them manually through Create
button in Inspector. Instead I want this to happen automatically.
This should look somthing like scripts below. So that I could drag the original_float
to float_to_change
field right in the Inspector.
// First Component
public class FirstScript : MonoBehaviour
{
public DraggableFloat original_float = 5.0f;
}
// SecondComponent
public class SecondScript: MonoBehaviour
{
public DraggableFloat float_to_change;
public void ChangeFloat()
{
// The value of original_float is changed through reference
float_to_change += 10.0f;
}
}