// Initialize All Components private void Start() { A_InteractBehaviour aib = (A_InteractBehaviour)this.gameObject.AddComponent(myBehaviour.GetType()) ; aib.Initialize( myBehaviour ); aib.interactParent = this; myBehaviour = aib; }
// Essentially A Copy Constructor public abstract void Initialize(A_InteractBehaviour behaviourParameters);
// Constructor For Custom Inspector public void InitializeComponent(string text, Sprite sprite, KeyCode key, Text uiText, Image uiImage, GameObject uiParent, A_InteractBehaviour ib) { InteractEventText = text; InteractEventImage = sprite; InteractEventKey = key; TextUI = uiText; ImageUI = uiImage; ParentUI = uiParent; myBehaviour = ib; }