Beispiel #1
0
    /// <summary>
    /// Created to Report Ambience Sound. I need to see how many diff crsytals are
    /// to detect River, Ocean shore and Full Ocean
    /// </summary>
    /// <returns></returns>
    private string DefineWhichAudioIReport()
    {
        //106 ocean shore, 84 river , 64 riv
        if (Index == 106 || Index == 84 || Index == 64)
        {
            var a = 1;
        }
        if (Index == 51)
        {
            var a = 1;
        }

        var myCrsytals = ReturnDiffCrystalsNames();
        //crystals that are seaType
        var seaTypes   = myCrsytals.Where(a => a.Type1 == H.WaterObstacle).ToList();
        var mountTypes = myCrsytals.Where(a => a.Type1 == H.MountainObstacle).ToList();

        var linkTypes   = myCrsytals.Where(a => a.Type1 == H.LinkRect).ToList();
        var uniqueZones = ReturnDiffCrystals(linkTypes, H.LinkRect);

        if (myCrsytals.Count == 1)
        {
            return("InLand");
        }
        else if (mountTypes.Count > 0)
        {
            return("Mountain");
        }
        else if (myCrsytals.Count > 1 && uniqueZones.Count == 0)
        {
            return("Later");//OceanSHore
        }
        else if (myCrsytals.Count > 1 && uniqueZones.Count == 1)
        {
            //this ones will find later if have a Full Ocean around if they do that
            //it is OceanShore. Otherwise is River
            return("Later");
        }
        else if (myCrsytals.Count > 1 && uniqueZones.Count > 1)
        {
            return("River");
        }

        if (!UTerra.IsOnTerrain(U2D.FromV2ToV3(Region.center)))
        {
            return("OutOfTerrain");
        }

        return("FullOcean");
    }
Beispiel #2
0
    private float step = 10f;//3f was working ok for mountain

    private void DefinePositionsToCheck(Vector3 primeVector)
    {
        positionsToCheck.Clear();
        float   dist = Vector3.Distance(primeVector, _mid);//sp it goes twice as far to check
        Vector3 t    = _mid;

        for (float i = 0; i < dist; i = i + step)
        {
            t = Vector3.MoveTowards(t, primeVector, step);
            //if is not on Terrain will break loop so wont add antyhing else towards that Prime
            //bz sim,ply after that is just out of terrain. In this way I will never RayCast a point
            //out of terrain
            if (!UTerra.IsOnTerrain(t))
            {
                //Debug.Log("not on terrain Delta DefinePositionsToCheck()");
                break;
            }
            step *= 2f;
            positionsToCheck.Add(t);
        }
        //_person.DebugList.AddRange(UVisHelp.CreateHelpers(positionsToCheck, Root.blueSphereHelp));
        step = 10f;
    }