public void OnSoundAreaExit(SpringPoint point) { enteredPoints = enteredPoints.Where(p => p != point).ToArray(); if (enteredPoints.Length == 0) { TryStopSeLoop(); } }
/** Create points to be used on the water's surface. */ private List <SpringPoint> MakeWavePoints(int numPoints) { List <SpringPoint> springs = new List <SpringPoint>(); for (int n = 0; n < numPoints; n++) { // This represents a point on the wave SpringPoint newPoint = new SpringPoint() { x = (((float)n / numPoints) * width) + transform.position.x, y = yOffset, speed = Vector2.zero, mass = 1 }; springs.Add(newPoint); } return(springs); }
public bool IsNearPlayer(SpringPoint point) { return(player.IsNearPoint(point)); }
public void OnPickPoint(SpringPoint point) { activePoints = activePoints.Where(p => p != point).ToArray(); Debug.Log(activePoints.Length); }
public void OnSoundAreaEnter(SpringPoint point) { enteredPoints = enteredPoints.Union(Enumerable.Repeat(point, 1)).ToArray(); TryPlaySeLoop(); }
public bool IsNearPoint(SpringPoint point) { var springPoint = FindNearPoint(); return(springPoint != null && springPoint == point); }