fixed camera system and brightened recipticles
This commit is contained in:
40
Assets/Scripts/Enviornment/EmissiveLightMatching.cs
Normal file
40
Assets/Scripts/Enviornment/EmissiveLightMatching.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class EmissiveLightMatching : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private List<int> indexes;
|
||||
private List<Color> colors= new List<Color>();
|
||||
[SerializeField]
|
||||
private Light reference;
|
||||
private float initIntensity;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
initIntensity = reference.intensity;
|
||||
}
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
foreach(int index in indexes) {
|
||||
colors.Add(this.gameObject.GetComponent<MeshRenderer>().materials[index].GetColor("_EmissiveColor"));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
int x = 0;
|
||||
foreach(int i in indexes)
|
||||
{
|
||||
|
||||
this.gameObject.GetComponent<MeshRenderer>().materials[i].SetColor("_EmissiveColor", colors[x] * ((10*reference.intensity / initIntensity)));
|
||||
x++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
11
Assets/Scripts/Enviornment/EmissiveLightMatching.cs.meta
Normal file
11
Assets/Scripts/Enviornment/EmissiveLightMatching.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5121ccf5a359b594aa31296fd9902dfb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user