Tanoda
UIShadowEdit.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.UI;
5
6[RequireComponent(typeof(Shadow))]
7public class UIShadowEdit : MonoBehaviour
8{
9 private Shadow sw;
10 private void Start()
11 {
12 sw = GetComponent<Shadow>();
13 }
14
15 public void SetShadowEffect(string value)
16 {
17 var t = value.Split(';');
18 sw.effectDistance = new Vector2(Macro.StoF(t[0]), Macro.StoF(t[1]));
19 }
20
21 public void ToggleShadow()
22 {
23 sw.effectDistance = sw.effectDistance.x > 0 ? new Vector2(-1, 1) : new Vector2(1, -1);
24 }
25}
Definition: Macro.cs:12
static float StoF(string value)
Definition: Macro.cs:24
void SetShadowEffect(string value)
Definition: UIShadowEdit.cs:15
void ToggleShadow()
Definition: UIShadowEdit.cs:21