Created
September 22, 2019 13:30
-
-
Save gHashTag/ee9c4fde0b2af743c120459e7c928f2e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const NativeUI = require('NativeUI') | |
| const Scene = require('Scene') | |
| const Textures = require('Textures') | |
| const plane = Scene.root.find('faceMesh0') | |
| const texture0 = Textures.get('texture0') | |
| const texture1 = Textures.get('texture1') | |
| const texture2 = Textures.get('texture2') | |
| const picker = NativeUI.picker | |
| const index = 0 | |
| const configuration = { | |
| selectedIndex: index, | |
| items: [ | |
| {image_texture: texture0}, | |
| {image_texture: texture1}, | |
| {image_texture: texture2} | |
| ] | |
| } | |
| picker.configure(configuration) | |
| picker.visible = true | |
| picker.selectedIndex.monitor().subscribe(function(index) { | |
| plane.material.diffuse = configuration.items[index.newValue].image_texture; | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment