69 lines
1.2 KiB
C#
69 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using Sirenix.OdinInspector;
|
|
|
|
public enum ESceneObjectType
|
|
{
|
|
None = 0,
|
|
Tree = 1, //树
|
|
}
|
|
|
|
/// <summary>
|
|
/// 场景中对象,可以方便地执行一些渲染上的效果,如半透,面片渲染等
|
|
/// </summary>
|
|
public class SceneObject : MonoBehaviour
|
|
{
|
|
#region Fields
|
|
|
|
[SerializeField]
|
|
[LabelText("是否半透")]
|
|
[OnValueChanged("Refresh")]
|
|
private bool _transparent;
|
|
|
|
[SerializeField]
|
|
[LabelText("是否使用面片")]
|
|
[OnValueChanged("Refresh")]
|
|
private bool _useSurface;
|
|
|
|
[ReadOnly]
|
|
[HideInInspector]
|
|
[SerializeField]
|
|
private SceneObjectRenderInfo _renderInfo;
|
|
|
|
#endregion
|
|
|
|
#region API
|
|
|
|
public bool Transparent
|
|
{
|
|
get => _transparent;
|
|
set
|
|
{
|
|
if (_transparent != value)
|
|
{
|
|
_transparent = value;
|
|
Refresh();
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool UseSurface
|
|
{
|
|
get => _useSurface;
|
|
set
|
|
{
|
|
if (_useSurface != value)
|
|
{
|
|
_useSurface = value;
|
|
Refresh();
|
|
}
|
|
}
|
|
}
|
|
|
|
private void Refresh()
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
} |