ruk·si

⬜️ Unity
Private Properties

Updated at 2016-10-15 12:03

You can create private properties to MonoBehaviours so they still show in inspector.

using UnityEngine;

public class LaserObstacle : MonoBehaviour
{
    [SerializeField]
    private int damageAmount;
    public int DamageAmount {
        get { return damageAmount; }
    }

    [SerializeField]
    private float DamageDuration;

    [SerializeField]
    private int NumberOfBeams;

    [SerializeField]
    private GameObject LaserPrefab;
}