passing paramters to a subclass? c#

using UnityEngine;
using System.Collections;

public class CrateController : MonoBehaviour {
	
	public int breakStrength = 2;
	public int plankLifetime = 3;
	public Transform destructionLevel2;
}



using UnityEngine;
using System.Collections;

public class CrateController_DL2_Master : CrateController {
	
	
}

I’m building a destructible crate and I want to declare some parameters in the base class and pass them to its subclasses. How do I keep the variables from being exposed in the subclasses editor window?

Make them protected or internal rather than public.

You could write a custom editor for each object and only gui the things you need but thats probably more work than it’s worth. I would just keep it with the extra things that you don’t need. If you really want those things to not be editable in the base class you could keep the protected and write getter/setter and do something in them like:

if(this != BaseClass)
  return;

m_var = value;