Skip to content

Commit

Permalink
add if conditions to clones
Browse files Browse the repository at this point in the history
  • Loading branch information
kfarr committed Feb 1, 2025
1 parent 73c54d4 commit e7f5595
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/components/street-generated-clones.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,21 @@ AFRAME.registerComponent('street-generated-clones', {
mode: { default: 'fixed', oneOf: ['fixed', 'random', 'single'] },

// Spacing for fixed and random modes
spacing: { default: 15, type: 'number' }, // minimum distance between objects
spacing: { default: 15, type: 'number', if: { mode: ['fixed', 'random'] } }, // minimum distance between objects

// Fixed mode properties
cycleOffset: { default: 0.5, type: 'number' }, // offset as a fraction of spacing, only for fixed
cycleOffset: { default: 0.5, type: 'number', if: { mode: ['fixed'] } }, // offset as a fraction of spacing, only for fixed

// Random mode properties
count: { default: 1, type: 'number' },
count: { default: 1, type: 'number', if: { mode: ['random'] } },

// Single mode properties
justify: { default: 'middle', oneOf: ['start', 'middle', 'end'] },
padding: { default: 4, type: 'number' }
justify: {
default: 'middle',
oneOf: ['start', 'middle', 'end'],
if: { mode: ['single'] }
},
padding: { default: 4, type: 'number', if: { mode: ['single'] } }
},

init: function () {
Expand Down

0 comments on commit e7f5595

Please sign in to comment.