Exemple #1
0
            private SpiralPickerItem CreatePrefab(SpiralPickerItem prefab, Transform parent)
            {
                var go = PrefabUtility.InstantiatePrefab(prefab.gameObject, parent) as GameObject;

                Undo.RegisterCreatedObjectUndo(go, "Create radial menu slot");
                return(go.GetComponent <SpiralPickerItem>());
            }
Exemple #2
0
        private void SpawnSlotsHolders(
            int wingsSlotsshown,
            System.Func <Transform, SpiralPickerItem> spawnCallback)
        {
            var totalSlotsCount = 1 + wingsSlotsshown + wingsSlotsshown;

            slots = new SpiralPickerItem[totalSlotsCount];
            for (int i = 0; i < totalSlotsCount; i++)
            {
                SpiralPickerItem item = spawnCallback(slotsContainer);
                slots[i] = item;
            }
        }