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 UnityEngine; | |
public class SpriteAlphaFlicker : MonoBehaviour | |
{ | |
public float flickersPerSecond = 15f; | |
public float flickerRangeMin = -0.1f; | |
public float flickerRangeMax = 0.1f; | |
private SpriteRenderer spriteRenderer; | |
private float alpha; |
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 UnityEngine; | |
public class FollowMouse : MonoBehaviour | |
{ | |
public float positionZ = 0; | |
private void Update() | |
{ | |
Vector3 mouseWorldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition); | |
mouseWorldPosition.z = positionZ; |