public bool IsInsideLiquid(Example_2_5_Liquid l) { if ( //location.x > (l.x - l.w/2) && location.x < (l.x + l.w/2) && /*location.y > (l.y - l.h/2) &&*/ location.y < l.y) { return(true); } else { return(false); } }
// Use this for initialization void Start() { Liquid = new Example_2_5_Liquid(CSizeX / 2, CSizeY / 2, CSizeX, CSizeY, 20); Liquid.displayLiquid(); for (int i = 0; i < movers.Length; i++) { // TODO Fix NEW Warning when instatiating, make mono happy. RandMass[i] = UnityEngine.Random.value; movers[i] = new Example_2_5_Mover(RandMass[i], (float)i * CSizeX / movers.Length, 9f); spheres[i] = GameObject.CreatePrimitive(PrimitiveType.Sphere); spheres[i].transform.position = new Vector3(UnityEngine.Random.value, UnityEngine.Random.value, UnityEngine.Random.value); spheres[i].transform.localScale = new Vector3(RandMass[i], RandMass[i], RandMass[i]); } }