// -http://forum.unity3d.com/threads/add-component-to-3d-object-with-parameters-to-constructor.334757/ public static InteractiveController addToGameObject(MainObject mainObject) { GameObject gameObject = GameObject.Find(mainObject.ObjectName); InteractiveController interactiveController = gameObject.AddComponent <InteractiveController>(); interactiveController.mainObject = mainObject; return(interactiveController); }
protected void interactiveProcessing(SceneInfo sceneInfo) { foreach (MainObject mainObject in sceneInfo.mainObjects) { InteractiveController interactiveController = InteractiveController.addToGameObject(mainObject); interactiveController.interactiveCallBack = interactiveCallBack; interactiveController.displayTextUiController = displayTextUiController; } }
public abstract void Interact(InteractiveController controller);