I try to code a script to change the skybox when someone touch the touch pad (of the samsung gear VR). I make some research about the touchpad input, and I found that it's supposed to work like a mouse. Sooo I've done this :
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class skyboxSwitcher : MonoBehaviour {
public List<Material> boxes = new List<Material>();
private int index = 0;
void Update() {
if (Input.GetMouseButtonDown(0))
switchBox();
}
public void switchBox() {
if (boxes.Count > 0) {
index++;
if (index >= boxes.Count) {
index = 0;
}
RenderSettings.skybox = boxes[index];
}
}
}
But it's does not work. I read the documentation and try some other inputs, but still get the same result. Maybe someone already had the same issue? Thanks :)