Exemplo n.º 1
0
 public static void CreateMap(int width, int height, List <List <string> > content)
 {
     Map             = new Map <Cell>(width, height);
     NoiseController = new NoiseController(width, height);
     LightController = new LightController(width, height);
     FillMap(content);
 }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 3
0
 public void Init(NoiseController parent)
 {
     this.parent        = parent;
     Frequency          = 1f;
     Exponent           = 1f;
     Terraces           = 0f;
     Weight             = 1f;
     width              = parent.textureSize.x;
     height             = parent.textureSize.y;
     noiseTexture       = new Texture2D(width, height);
     noiseImage.texture = noiseTexture;
     map = new float[width, height];
     GenerateTexture();
 }
Exemplo n.º 4
0
    public List <ImageSource> calculateNoise(NoiseController controller, NoiseSource src, noiseParameters vehicleParams)
    {
        currController = controller;
        currSource     = src;
        currVehicle    = vehicleParams;
        images         = new List <ImageSource>();
        List <propagationStep> start = new List <propagationStep>();

        //turn propagation paths into image sources
        //Recursively work through to the leafs, then add to images
        foreach (TreeNode <NoiseSource> node in src.node.Children)
        {
            pathFromTo(src.node, src.node, node, 0, 0, start);
        }
        //After this loop, the list of images is populated
        return(images);
    }
    public void DisplayInEditor()
    {
        textureDetails.AttachToMaterial(areaMaterial);
        textureDetails.RefreshHeights(areaMaterial, areaNoiseDetails.minHeight, areaNoiseDetails.maxHeight);

        AreaNoise noiseArea = NoiseController.BuildNoiseArea(areaDetails.verticesPerLine, areaNoiseDetails, Vector2.zero);

        if (displayMode == DisplayMode.Noise)
        {
            DisplayMap(TextureController.GenerateFromNoise(noiseArea));
        }
        else if (displayMode == DisplayMode.Mesh)
        {
            DisplayMesh(MeshController.BuildMesh(noiseArea.area, previevLOD, areaDetails));
        }
        else if (displayMode == DisplayMode.Falloff)
        {
            DisplayMap(TextureController.GenerateFromNoise(new AreaNoise(FalloffController.GenerateFalloffArea(areaDetails.verticesPerLine), 0, 1)));
        }
    }
Exemplo n.º 6
0
    void Start()
    {
        GameObject childObject = transform.Find("GameOverUI").gameObject;

        noiseController = childObject.GetComponent <NoiseController>();
    }
 public void Load()
 {
     ThreadHandler.RequestDetails(() => NoiseController.BuildNoiseArea(areaDetails.verticesPerLine, areaNoiseDetails, center), OnAreaNoiseReceived);
 }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     audioPlayers   = new List <AudioSource>();
     hasInitialized = true;
     currController = transform.parent.GetComponent <NoiseController>();
 }