Exemplo n.º 1
0
 private void Awake()
 {
     // Find our owner.
     _owner = FindInParents <IDraggableMenu>(gameObject);
     if (_owner == null)
     {
         Debug.Log("Could not find the correct IDraggableMenu as parent.");
         Destroy(this);
     }
 }
Exemplo n.º 2
0
        private void InitializeDraggables(IDraggableMenu draggableMenu)
        {
            MCMenu mcMenu = (MCMenu)target;

            Draggable[] draggables = mcMenu.GetComponentsInChildren <Draggable>();

            for (int i = 0; i < draggables.Length; i++)
            {
                SerializedObject so = new SerializedObject(draggables[i]);
                so.Update();
                so.FindProperty("Owner").objectReferenceValue = mcMenu;
                so.ApplyModifiedProperties();
            }
        }