Example #1
0
    private IEnumerator Delay()
    {
        yield return(new WaitForSeconds(delayTime));

        // 简易版本的探索
        float effectDist = Mathf.Lerp(0.0f, maxRadius, effect.Value());

        //Debug.Log("ActiveSonar="+effectDist + ":" + Time.time);
        if (enemy)
        {
            //Debug.Log(effectDist + "- Enemy Search :" + enemy.SonarChildren().Count);
            Search(enemy.SonarChildren(), effectDist);
        }
        if (item)
        {
            //Debug.Log(effectDist + "- Item Search :" + item.SonarChildren().Count);
            Search(item.SonarChildren(), effectDist);
        }
        if (torpedo)
        {
            //Debug.Log(effectDist + "- Torpedo Search :" + torpedo.SonarChildren().Count);
            Search(torpedo.SonarChildren(), effectDist);
        }

        StartCoroutine("Delay");
    }