// Use this for initialization public void Start() { InitializeCameras(); //Hook GUI menus configView = GameObject.Find("Motion3DConfigView"); setState1stOrderView = GameObject.Find("SetState1stOrderView"); setState2ndOrderView = GameObject.Find("SetState2ndOrderView"); mainMenuView = GameObject.Find("MainMenuView"); timeSliderComponent = GameObject.Find("TimeSlider").GetComponent <TimeSlider>(); userDefinedView = GameObject.Find("UserDefinedView"); fileManagerView = GameObject.Find("FileManagerView"); //Close GUI menus configView.SetActive(false); setState1stOrderView.SetActive(false); setState2ndOrderView.SetActive(false); mainMenuView.SetActive(false); userDefinedView.SetActive(false); fileManagerView.SetActive(false); //Hook Simulation Controller simController = gameObject.GetComponent <Motion3DSimulationController>(); //Hook Motion3DObject's static reference to PositionTextModel Motion3DObject.positionTextModel = GameObject.Find("PositionTextModel"); Motion3DObject.positionTextModel.SetActive(false); instance = new InputField[100]; instanceText = new Text[100]; }
// Use this for initialization public void Start() { //Initialize update frequency updateFrequencyManager = new UpdateFrequencyManager(UPDATE_FREQUENCY); //Hook simulation controller reference simController = gameObject.GetComponent <Motion3DSimulationController>(); //Hook arrow reference arrow = GameObject.Find("VectorModel"); arrow.SetActive(false); //lazy initialization of vector field. Will initialize on first enable vectorField = 0; initialized = false; F = null; }
//Applies the problem to a Motion3DSimulationController public void Apply(Motion3DSimulationController simController) { //1. Make a Motion3DSetup Motion3DSetup setup = new Motion3DSetup(expressionX, expressionY, expressionZ, parameters, order); //Just by calling the above constructor all parameter values are entered and equations parsed //2. Apply the configuration (simController.ApplyConfiguration(...)) simController.ApplyConfiguration(setup); //3. Add Object and set initial conditions // Since an object is selected after it is added, you can do this by // AddObject() and then SetStateOnCurrentObject() iteratively. for (int i = 0; i < numberOfObjects; i++) { simController.AddObject(); simController.SetStateOnCurrentObject(initialConditions[i]); } }