-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathReadOnlyUnityObjects.cs
More file actions
22 lines (20 loc) · 921 Bytes
/
Copy pathReadOnlyUnityObjects.cs
File metadata and controls
22 lines (20 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using System.Linq;
using UnityEngine;
namespace AnySerialize
{
public class ReadOnlyUnityObjects : MonoBehaviour
{
[AnySerialize] public GameObject GameObject { get; }
[AnySerialize] public AnyScriptableObject ScriptableObject { get; }
[AnySerialize] public AnimationCurve AnimationCurve { get; }
[AnySerialize] public GameObject[][] GameObjectArray2 { get; }
private void Awake()
{
Debug.Log($"-------------------------{GetType().Name}---------------------------");
Debug.Log($"{nameof(GameObject)} = {GameObject.name}");
Debug.Log($"{nameof(ScriptableObject)} = {ScriptableObject.name}");
Debug.Log($"{nameof(AnimationCurve)} = {AnimationCurve.length}");
Debug.Log($"{nameof(GameObjectArray2)} = {string.Join(",", GameObjectArray2.SelectMany(arr => arr).Select(obj => obj.name))}");
}
}
}