@@ -366,16 +366,24 @@ public class SkyboxBlender : MonoBehaviour
|
||||
// set the skybox material
|
||||
void SetSkyBoxes(bool firstTex = false, int firstTexIndex = 0, bool secondTex = false, int secondTexIndex = 0, bool apply = false)
|
||||
{
|
||||
if (firstTex)
|
||||
try
|
||||
{
|
||||
skyboxBlenderMaterial.SetTexture("_Tex", skyboxMaterials[firstTexIndex].GetTexture("_Tex"));
|
||||
skyboxBlenderMaterial.SetColor("_Tint", skyboxMaterials[firstTexIndex].GetColor("_Tint"));
|
||||
}
|
||||
if (firstTex)
|
||||
{
|
||||
skyboxBlenderMaterial.SetTexture("_Tex", skyboxMaterials[firstTexIndex].GetTexture("_Tex"));
|
||||
skyboxBlenderMaterial.SetColor("_Tint", skyboxMaterials[firstTexIndex].GetColor("_Tint"));
|
||||
}
|
||||
|
||||
if (secondTex)
|
||||
if (secondTex)
|
||||
{
|
||||
skyboxBlenderMaterial.SetTexture("_Tex2", skyboxMaterials[secondTexIndex].GetTexture("_Tex"));
|
||||
skyboxBlenderMaterial.SetColor("_Tint2", skyboxMaterials[secondTexIndex].GetColor("_Tint"));
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
skyboxBlenderMaterial.SetTexture("_Tex2", skyboxMaterials[secondTexIndex].GetTexture("_Tex"));
|
||||
skyboxBlenderMaterial.SetColor("_Tint2", skyboxMaterials[secondTexIndex].GetColor("_Tint"));
|
||||
Debug.LogWarning("Skybox Blender: There was an error setting the skybox materials. Please make sure the indices are correct and the materials are assigned.");
|
||||
|
||||
}
|
||||
|
||||
if (apply)
|
||||
|
||||
Reference in New Issue
Block a user