Ejemplo n.º 1
0
    private void FixedUpdate()
    {
        if (magnetTool.IsOn())
        {
            Attractor attractor = magnetTool.GetComponent <Attractor> ();
            attractor.strength = attractorStrength;
            attractor.minDist  = attractorMinDist;
            attractor.maxDist  = attractorMaxDist;

            foreach (Transform spaceObject in spaceObjects)
            {
                SpaceObject obj = spaceObject.GetComponent <SpaceObject> ();

                obj.springStrength = springStrength;
                obj.damping        = springDamping;
                obj.AttractTo(attractor);
            }
        }
    }