예제 #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();
    }
예제 #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;
    }
예제 #3
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;
    }