Fix camp fog mat ref
This commit is contained in:
parent
fbee51b6d4
commit
ca0259989b
@ -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
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user