using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using UniRx; public class PowerCreate : MonoBehaviour { public string PowerName; public CreationMode CreateMode; // Start is called before the first frame update void Start() { GetComponent().OnValueChangedAsObservable() .Subscribe(value=> { if (value) { PowerManager.Instance.isEnabled = true; PowerManager.Instance.powerName = PowerName; PowerManager.Instance.CreateMode = CreateMode; PowerManager.Instance.Initialization(); } else { PowerManager.Instance.isEnabled = false; PowerManager.Instance.isCreate = false; PowerManager.Instance.isWarningLine = false; PowerManager.Instance.powerName = ""; PowerManager.Instance.CreateMode = CreationMode.None; } }).AddTo(gameObject); } }