コード例 #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);
    }