Hi guys, I have variable name is sayi. This is sayi variable type to int. Simple if control. But skybox material isn't change. My code; PHP: import UnityEngine import System.Collections class Gokyuzu (MonoBehaviour): def Start (): a as int = 0 gok as Skybox gok.enabled = true if a == 0: gok.material("Sunny1 Skybox") else: gok.material("DawnDusk Skybox") def Update (): pass How do you change skybox material? Thank you advanced for interest, now. Good work..
Have you added a skybox component to your camera? http://docs.unity3d.com/Documentation/Components/class-Skybox.html
Here's a c# version I just wrote and tested. Dont know boo though, so you can either just have a c# script in your project or convertit. Code (csharp): using UnityEngine; using System.Collections; using System.Collections.Generic; public class SkyController : MonoBehaviour { int index = 0; Skybox _skybox; public List<Material> SkyBoxes; // Use this for initialization void Start () { _skybox = (Skybox)GetComponent(typeof(Skybox)); InvokeRepeating("NewSky", 10,10); } void NewSky() { if(_skybox == null || SkyBoxes == null) return; if(SkyBoxes.Count == 0) return; index++; if(index == SkyBoxes.Count) index = 0; _skybox.material = SkyBoxes[index]; } }