2021-07-04 01:00:01 +08:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2021-08-18 00:50:19 +08:00
|
|
|
using UnityEditor;
|
2021-07-04 01:00:01 +08:00
|
|
|
|
|
|
|
public class AllLinesInfo : MonoBehaviour
|
|
|
|
{
|
2021-08-07 01:31:29 +08:00
|
|
|
//总线信息类,用来存储场景中电话线断裂的总体信息,
|
2021-07-04 01:00:01 +08:00
|
|
|
// Start is called before the first frame update
|
2021-08-18 00:50:19 +08:00
|
|
|
[ReadOnly][SerializeField]
|
|
|
|
private int needCount;
|
2021-07-04 01:00:01 +08:00
|
|
|
public int OKCount = 0;
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
needCount = transform.childCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2021-08-07 01:31:29 +08:00
|
|
|
|
|
|
|
public bool AreYouOK(){return (needCount == OKCount);}//返回完成量是不是等于需求量
|
2021-08-18 00:50:19 +08:00
|
|
|
|
|
|
|
//制造一个只读的变量,不要动这些
|
|
|
|
public class ReadOnlyAttribute : PropertyAttribute{}
|
|
|
|
[CustomPropertyDrawer(typeof(ReadOnlyAttribute))]
|
|
|
|
public class ReadOnlyDrawer : PropertyDrawer
|
|
|
|
{
|
|
|
|
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
|
|
|
|
{
|
|
|
|
return EditorGUI.GetPropertyHeight(property, label, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
|
|
|
|
{
|
|
|
|
GUI.enabled = false;
|
|
|
|
EditorGUI.PropertyField(position, property, label, true);
|
|
|
|
GUI.enabled = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
2021-07-04 01:00:01 +08:00
|
|
|
}
|