Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Changing mesh shader not working iOS

$
0
0
I have 2 custom shaders that we allow players to cycle through which show different topographical details on our terrain mesh. Players can toggle each shader with a button click in our UI. This has worked beautifully in our Android builds, but does not work on an iPhone. When I try and toggle the shader, it blips to pink for a split second, then goes back to what it was before. Also, it does work on an iPad just fine, which is odd. Could there be a graphics setting I am overlooking? Is this an iPhone hardware issue? Below is the script for the button to rotate shaders on our meshes. public class NewLayersButton : MonoBehaviour { public Material green; public Material collar; public Material rough; public Material[] layers; public string[] labels; public float labelTime = 1.0f; private Text label; private Image image; private int layerIndex = 0; private float labelTimer; public void Awake() { label = this.GetComponentInChildren (); image = this.GetComponent (); } public void OnGUI() { if (Time.time > labelTime + labelTimer) { label.text = ""; image.enabled = true; } } public void tapFunction () { layerIndex = (layerIndex >= layers.Length - 1)? 0 : layerIndex + 1; green = layers [layerIndex]; collar = layers [layerIndex]; rough = layers [layerIndex]; label.text = labels [layerIndex]; image.enabled = false; labelTimer = Time.time; } }

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>