You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
1 year ago
|
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<Toggle>().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);
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|