Exemplo n.º 1
0
    public void CreateBackground()
    {
        prefabs[0] = Resources.Load("4x4 Black") as GameObject;
        prefabs[1] = Resources.Load("4x4 White") as GameObject;
        string tag = "Background_Prefab";

        SimulateController.DestroyObjectsWithTag(tag);

        GetMin(0);
        GetMin(1);
        GetMin(2);
        GetMax(0);
        GetMax(1);
        GetMax(2);
        CalculateNumberOfinstatiates();

        Debug.Log("Number of instances");
        Debug.Log(NumberOfInstatiates);

        Debug.Log(min[0]);
        Debug.Log(min[1]);
        Debug.Log(min[2]);

        Debug.Log(max[0]);
        Debug.Log(max[1]);
        Debug.Log(max[2]);

        InstatiatePrefabs();
    }
Exemplo n.º 2
0
    public void ResetUi()
    {
        SimulateController.DestroyObjectsWithTag("Simulation");

        InputField_s_x.text = "";
        InputField_s_y.text = "";
        InputField_s_z.text = "";

        InputField_u_x.text = "";
        InputField_u_y.text = "";
        InputField_u_z.text = "";

        InputField_v_x.text = "";
        InputField_v_y.text = "";
        InputField_v_z.text = "";

        InputField_a_x.text = "";
        InputField_a_y.text = "";
        InputField_a_z.text = "";

        InputField_Time.text = "";

        InputField_r_x.text = "";
        InputField_r_y.text = "";
        InputField_r_z.text = "";

        InputField_Mass.text    = "";
        InputField_Radius.text  = "";
        SliderRestitution.value = 1;

        ToggleGravity.isOn    = true;
        ToggleCollisions.isOn = true;
    }
Exemplo n.º 3
0
        public void Post_simulate_goals_should()
        {
            // Arrange
            var vm         = new SimulateGoalVM();
            var responseVM = new SimulateGoalResultVM();

            _mockWalletService.Setup(x => x.AddAsync(vm)).ReturnsAsync(responseVM);

            // Action
            var _sut   = new SimulateController(_mockWalletService.Object);
            var result = _sut.Post(vm).Result;

            // Assert
            Assert.NotNull(result);
        }
Exemplo n.º 4
0
    public void OnSimulateClicked()
    {
        Particle values     = CalculateController.CalculateControl();
        int      dimentions = DropBoxDimention.value + 1;

        if (dimentions <= 2)
        {
            SimulateController.OnSimulateClicked();
        }
        else
        {
            //For when I want diffrent camera angles
            SimulateController.OnSimulateClicked();
        }
    }
Exemplo n.º 5
0
    public void OnResetSimulationClikced()
    {
        int particleSelected = DropBoxParticle.value;

        for (int i = 0; i < Particle.Instances.Count; i++)
        {
            Particle.Instances[i] = Particle.Instances[i].beforeSimulation;
        }
        UpdateUI(Particle.Instances[particleSelected]);

        string tag = "Simulation";

        SimulateController.DestroyObjectsWithTag(tag);

        SimulateController.isSimulating = false;
    }