コード例 #1
0
ファイル: Aim.cs プロジェクト: realivan/shooting
    public void Targering()
    {
        float aimTime = Time.time - startUnderAimTime;          // время нахождения в прицел

        if (lastSecond && 5 - (Time.time - plateAim.startTime) <= 0.1f)
        {
            int   n       = Random.Range(0, 100);
            float percent = aimTime * 10;
            // процент попадания
            if (percent >= n)
            {
                plateAim.DestroyPlate(true);
            }
        }
        else if (aimTime >= underAimTime)
        {
            plateAim.DestroyPlate(true);
        }
    }