- Home /
Question by
nicloay · Mar 11, 2013 at 04:46 AM ·
c#programminginheritancemonobehaviour
Is it possible to make sealed overridden MonoBehaviour method.
I wan't to create a base class for my component and want to prevent all class which derive from it override OnMouseClick and so on methods.
I expect something like this
using UnityEngine;
using System.Collections;
public delegate void OnEnter(BaseClass baseClass);
public class BaseClass : MonoBehaviour {
public static OnEnter onEnter;
public sealed override void OnMouseEnter(){
if (onEnter != null)
onEnter(this);
OnMouseEnterWork();
}
public virtual void OnMouseEnterWork ()
{
}
}
Comment