Check out example codes for "unity serializable". It will help you in understanding the concepts better.
Code Example 1
using System;
using UnityEngine;public class Player : MonoBehaviour
{
//Create a custom struct and apply [Serializable] attribute to it
[Serializable]
public struct PlayerStats
{
public int movementSpeed;
public int hitPoints;
public bool hasHealthPotion;
} //Make the private field of our PlayerStats struct visible in the Inspector
//by applying [SerializeField] attribute to it
[SerializeField]
private PlayerStats stats;
}
Learn ReactJs, React Native from akashmittal.com