Created
May 29, 2019 07:22
-
-
Save IshidaGames/046d6012b95f9b605946a8202e27ed75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class lensFlare : MonoBehaviour { | |
LensFlare lf; | |
public GameObject player; | |
void Start () { | |
lf = GetComponent<LensFlare>(); | |
} | |
void Update () { | |
//このオブジェクトとPlayerの距離で強さを決める | |
lf.brightness = 10 / Vector3.Distance(lf.transform.position, | |
player.transform.position); | |
//フェードするスピードを指定 | |
lf.fadeSpeed = 0.5F; | |
//色を指定 | |
lf.color = Color.red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment