コード例 #1
0
 public void OnSoundAreaExit(SpringPoint point)
 {
     enteredPoints = enteredPoints.Where(p => p != point).ToArray();
     if (enteredPoints.Length == 0)
     {
         TryStopSeLoop();
     }
 }
コード例 #2
0
ファイル: Water.cs プロジェクト: shifatkhan/ProjectAS-Unity
    /** 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);
    }
コード例 #3
0
 public bool IsNearPlayer(SpringPoint point)
 {
     return(player.IsNearPoint(point));
 }
コード例 #4
0
 public void OnPickPoint(SpringPoint point)
 {
     activePoints = activePoints.Where(p => p != point).ToArray();
     Debug.Log(activePoints.Length);
 }
コード例 #5
0
 public void OnSoundAreaEnter(SpringPoint point)
 {
     enteredPoints = enteredPoints.Union(Enumerable.Repeat(point, 1)).ToArray();
     TryPlaySeLoop();
 }
コード例 #6
0
    public bool IsNearPoint(SpringPoint point)
    {
        var springPoint = FindNearPoint();

        return(springPoint != null && springPoint == point);
    }