예제 #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        KyoukoEchoNoise noise = other.GetComponent <KyoukoEchoNoise>();

        if (noise && noise.CanEcho())
        {
            kyouko.Miss();
        }
    }
예제 #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        KyoukoEchoNoise noise = other.GetComponent <KyoukoEchoNoise>();

        if (noise && noise.CanEcho() && kyouko.WillEcho)
        {
            noise.Echo(CalculateBodyHitLocationY(noise.transform.position.y));

            kyouko.Hit(name);
        }
    }
예제 #3
0
    void MakeNoise(float delay)
    {
        // Calculate random start position
        Bounds  bounds        = zone.bounds;
        Vector2 noisePosition = new Vector2(
            Random.Range(bounds.min.x, bounds.max.x),
            Random.Range(bounds.min.y, bounds.max.y));

        KyoukoEchoNoisePair noisePair = noisePairs[Random.Range(0, noisePairs.Length)];

        KyoukoEchoNoise noiseInstance = Instantiate(noise, noisePosition, transform.rotation);

        noiseInstance.SetNoise(noisePair);
        noiseInstance.Fire(kyouko.transform.position.x, kyouko.UpperBoundY, kyouko.LowerBoundY, delay);
    }