GridSystem.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        float inverseSnap = 1 / snap;
        float x, y, z;

        x = Mathf.Round (transform.localPosition.x * inverseSnap) / inverseSnap;
        y = Mathf.Round (transform.localPosition.y * inverseSnap) / inverseSnap;
        z = depth;

        transform.localPosition = new Vector3 (x, y, z);
    }
GridSystem