/// <summary>
 /// Method <c>Start</c> initializes webcamController object.
 /// <see cref="webcamController"/>.
 /// </summary>
 void Update()
 {
     if (webcamController == null)
     {
         webcamController = MapGenerator.webcamController;
     }
 }
Exemple #2
0
    /// <summary>
    /// Initializes and assigns values to this class' data members.
    /// </summary>
    void Start()
    {
        mapGenerator     = gameObject.GetComponent(typeof(MapGenerator)) as MapGenerator;
        webcamController = gameObject.GetComponent(typeof(WebcamTextureController)) as WebcamTextureController;

        chunkWidth  = mapGenerator.MapChunkWidth - 1;
        chunkHeight = mapGenerator.MapChunkHeight - 1;

        _face = gameObject.GetComponent(typeof(FaceDetection)) as FaceDetection;

        numChunkWidth  = mapGenerator.NumChunkWidth;
        numChunkHeight = mapGenerator.NumChunkHeight;

        terrainChunkArray = new TerrainChunk[numChunkWidth, numChunkHeight];

        InitializeChunks();
    }
    /// <summary>
    /// The start method used by Unity.
    /// This mostly contains calls to the various initializers for the different components used together to c
    /// </summary>
    private void Start()
    {
        webcamController = this.gameObject.GetComponent(typeof(WebcamTextureController)) as WebcamTextureController;

        face = this.gameObject.GetComponent(typeof(FaceDetection)) as FaceDetection;

        webcamController.Initialize();

        this.InitializeMapSizes();

        this.InitializeChunkSizes();

        this.InitializeNumOfChunks();

        this.fullNoiseMap = NoiseGenerator.GenerateNoiseMap(this.mapWidth, this.mapHeight, this.noiseData.seed, this.noiseData.noiseScale, this.noiseData.octaves, this.noiseData.persistance, this.noiseData.lacunarity, this.noiseData.offset, this.noiseData.normalizeMode);

        this.textureData.ApplyToMaterial(this.terrainMaterial);
    }
    private void InitializeWebcamController()
    {
        webcamController = gameObject.GetComponent(typeof(WebcamTextureController)) as WebcamTextureController;

        webcamController.Initialize();
    }