Fix camp fog mat ref

This commit is contained in:
Jens Pitkänen 2020-04-21 00:13:04 +03:00
parent fbee51b6d4
commit ca0259989b
2 changed files with 3 additions and 3 deletions

View File

@ -2877,7 +2877,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Player: {fileID: 1484782755}
FogMaterial: {fileID: 2100000, guid: cb39cf5f82f3b7d41aa60ecd72bc528d, type: 2}
FogMesh: {fileID: 380838727}
--- !u!1001 &396558707
PrefabInstance:
m_ObjectHideFlags: 0

View File

@ -5,9 +5,9 @@ using UnityEngine;
public class CampfireFog : MonoBehaviour {
public GameObject Player;
public Material FogMaterial;
public MeshRenderer FogMesh;
void Update() {
FogMaterial.SetFloat("_Transparency", Mathf.Min(Mathf.Sqrt(Mathf.Max((transform.position - Player.transform.position).magnitude - 15, 0)) / 100, 0.15f));
FogMesh.material.SetFloat("_Transparency", Mathf.Min(Mathf.Sqrt(Mathf.Max((transform.position - Player.transform.position).magnitude - 15, 0)) / 100, 0.15f));
}
}