コード例 #1
0
    public void CheckingZoneIni()
    {
        checkingtheZone = true;
        chasingPlayer   = false;

        playerSpottedSprite.enabled = false;
        checkingZoneSprite.enabled  = true;

        GetComponent <FOV_vBT>().viewAngle = alertviewAngle;
        //Points the Check INI
        for (int x = 0; x < checkZone_NumPoints; ++x)
        {
            Bounds  bounds_tmp = new Bounds(pointToGo[0], checkZoneSize);
            Vector3 pointTmp   = new Vector3(0, 0, 0);
            bool    check      = false;
            int     checkNum   = 0;
            while (!check && checkNum < 10)
            {
                pointTmp = Outils.RandomPointInBounds(bounds_tmp);
                check    = Outils.IsPointRecheable(pointTmp, pointToGo[0], this.gameObject, collidersCheckZone);
                ++checkNum;
            }
            if (checkNum < 10)
            {
                pointToGo.Add(pointTmp);
            }
        }
    }