Hello guys.
I need to change texture when the level1 is locked and unlocked.
Here is the script:
#pragma strict
var Level1Locked = true;
var Level1Unlocked = false;
var UnlockedTexture = Texture2D;
var LockedTexture = Texture2D;
function OnGUI()
{
if (Level1Locked == true)
renderer.material.mainTexture = LockedTexture;
}
And then i want something like that : if level1 is unlocked change texture to UnlockedTexture
I get the following error : Cannot convert ‘System.Type’ to ‘UnityEngine.Texture’…