예제 #1
0
    void FixedUpdate()
    {
        World.Update(4);

        //Keep in bounds
        foreach (Composite c in World.composites)
        {
            foreach (Particle p in c.particles)
            {
                p.pos = new Vector2(Mathf.Clamp(p.pos.x, 0, width), Mathf.Clamp(p.pos.y, -height, 0));
            }
        }
    }
예제 #2
0
    // Update is called once per frame
    void Update()
    {
        if (!isStarted)
        {
            UpdateLinks();
        }

        if (isStarted && !toggle.isOn)
        {
            verlet.Update();
            UpdateView();
            UpdateLinks();
        }
    }
예제 #3
0
 protected virtual void Update()
 {
     _verlet.Update();
     BuildMesh();
 }