// Start is called before the first frame update void Start() { spriteRenderer = GetComponent <SpriteRenderer>(); originalColor = spriteRenderer.color; //inside = false; magneticState = MagneticState.Inactive; }
public void PlayerOnRage() { if (Vector3.Distance(transform.position, PlayerManager.Instance.gameObject.transform.position) < radius) { magneticState = MagneticState.Activate; spriteRenderer.color = Color.Lerp(spriteRenderer.color, activatedColor, 5 * Time.deltaTime); } else { magneticState = MagneticState.Inactive; spriteRenderer.color = Color.Lerp(spriteRenderer.color, originalColor, 5 * Time.deltaTime); } }