Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     ai_state = AI_STATE.STOPPED;
     vxe = VoxelExtractionPointCloud.Instance;
     lastposition = new Vector3 ();
     init ();
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     vxe = VoxelExtractionPointCloud.Instance;
     biome = BiomeScript.Instance;
     //for (int i=0; i<spawnObjects.Length; i++)
     //	spawnObjects[i].SetActive (false);
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     vxe   = VoxelExtractionPointCloud.Instance;
     biome = BiomeScript.Instance;
     //for (int i=0; i<spawnObjects.Length; i++)
     //	spawnObjects[i].SetActive (false);
 }
Esempio n. 4
0
    public void checkWeirdPosition()
    {
        //Don't know yet why, but for some SpawnObjects, they have not had their Start function occur so vxe would be null
        if (vxe == null)
            vxe = VoxelExtractionPointCloud.Instance;
        float distsqr = (transform.position - vxe.camera.transform.position).sqrMagnitude;

        if (distsqr < minDistSqr) {
            //low quality check
            voxelBelow = vxe.isVoxelThere (myTrans.position + Vector3.down * 0.5f * vxe.voxel_size);
            //voxelBelow |= vxe.isVoxelThere (myTrans.position + Vector3.down * 0.5f * vxe.voxel_size + Vector3.right * 0.2f * vxe.voxel_size);
            //voxelBelow |= vxe.isVoxelThere (myTrans.position + Vector3.down * 0.5f * vxe.voxel_size + Vector3.left * 0.2f * vxe.voxel_size);
            //voxelBelow |= vxe.isVoxelThere (myTrans.position + Vector3.down * 0.5f * vxe.voxel_size + Vector3.forward * 0.2f * vxe.voxel_size);
            //voxelBelow |= vxe.isVoxelThere (myTrans.position + Vector3.down * 0.5f * vxe.voxel_size + Vector3.back * 0.2f * vxe.voxel_size);

            stuckInVoxel = vxe.isVoxelThere (myTrans.position + Vector3.up * 0.5f * vxe.voxel_size);
            //stuckInVoxel |= vxe.isVoxelThere (myTrans.position + Vector3.up * 0.5f * vxe.voxel_size + Vector3.right * 0.2f * vxe.voxel_size);
            //stuckInVoxel |= vxe.isVoxelThere (myTrans.position + Vector3.up * 0.5f * vxe.voxel_size + Vector3.left * 0.2f * vxe.voxel_size);
            //stuckInVoxel |= vxe.isVoxelThere (myTrans.position + Vector3.up * 0.5f * vxe.voxel_size + Vector3.forward * 0.2f * vxe.voxel_size);
            //stuckInVoxel |= vxe.isVoxelThere (myTrans.position + Vector3.up * 0.5f * vxe.voxel_size + Vector3.back * 0.2f * vxe.voxel_size);

            if (stuckInVoxel) {
                myTrans.position += Vector3.up * vxe.voxel_size;
            } else if (!voxelBelow) {
                myTrans.position -= Vector3.up * vxe.voxel_size;
            }
        }
    }
Esempio n. 5
0
 void Start()
 {
     vxe = VoxelExtractionPointCloud.Instance;
     obj = this.gameObject;
     myTrans = obj.transform;
     onVoxelDown = Vector3.down * vxe.voxel_size;
     vxCoord = Vector3.zero;
     normal = Vector3.zero;
     minDistSqr = 10 * vxe.voxel_size;
     minDistSqr = minDistSqr * minDistSqr;
 }
Esempio n. 6
0
    // Use this for initialization
    void Start()
    {
        vxe = VoxelExtractionPointCloud.Instance;
        biome = BiomeScript.Instance;
        defaultFlag = leftcam.clearFlags;
        defaultLightIntensity = light.intensity;
        fourpts = new Vector3[2];

        if(cubeswitch != null)
        {
            initPts();
        }
    }
Esempio n. 7
0
    // Use this for initialization
    void Start()
    {
        allMask = leftCam.cullingMask;
        noMask  = backCam.cullingMask;

        backCam.cullingMask = allMask;
        backCam.clearFlags  = CameraClearFlags.Skybox;
        backCam.GetComponent <AudioListener> ().enabled = true;
        leftCam.gameObject.SetActive(false);
        rightCam.gameObject.SetActive(false);
        canvas.worldCamera = backCam;

        headsetImage.SetActive(false);
        vxe = VoxelExtractionPointCloud.Instance;
        UpdatePreScanMessage();
    }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        ai_state = AI_STATE.STOPPED;
        vxe      = VoxelExtractionPointCloud.Instance;
        if (camera == null)
        {
            camera = vxe.camera;
        }

        itemspawn           = ItemSpawner.Instance;
        lastposition        = new Vector3();
        stepdownThreshold   = vxe.voxel_size * 2;
        stepdownThreshold   = stepdownThreshold * stepdownThreshold;
        playerFaceThreshold = vxe.voxel_size * 5;
        //init ();
    }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        allMask = leftCam.cullingMask;
        noMask = backCam.cullingMask;

        backCam.cullingMask = allMask;
        backCam.clearFlags = CameraClearFlags.Skybox;
        backCam.GetComponent<AudioListener> ().enabled = true;
        leftCam.gameObject.SetActive (false);
        rightCam.gameObject.SetActive (false);
        canvas.worldCamera = backCam;

        headsetImage.SetActive (false);
        vxe = VoxelExtractionPointCloud.Instance;
        UpdatePreScanMessage ();
    }
Esempio n. 10
0
    void Start()
    {
        //spawneditems = new GameObject[items.Length];


        //for (int i=0; i<items.Length; i++)
        //	spawneditems [i] = null;

        prevpositions = new IndexStack <Vec3Int> (new Vec3Int[20]);

        vxe = VoxelExtractionPointCloud.Instance;
        if (camera == null)
        {
            camera = vxe.camera;
        }
        biome = BiomeScript.Instance;
    }
Esempio n. 11
0
    void Start()
    {
        if (switchable)
        {
            mainObject.SetActive (true);
            alternateObject.SetActive (false);
        }

        vxe = VoxelExtractionPointCloud.Instance;
        obj = this.gameObject;
        myTrans = obj.transform;
        onVoxelDown = Vector3.down * vxe.voxel_size;
        vxCoord = Vector3.zero;
        normal = Vector3.zero;
        minDistSqr = 10 * vxe.voxel_size;
        minDistSqr = minDistSqr * minDistSqr;
    }
Esempio n. 12
0
    // Use this for initialization
    void Start()
    {
        vxe             = VoxelExtractionPointCloud.Instance;
        biome           = BiomeScript.Instance;
        mybiome         = biome.biomeArea [0].biome;
        occupiedNearMe  = new List <Chunks> ();
        assetChunkTable = new Dictionary <Vec3Int, GameObject> ();

        if (playerTrans == null)
        {
            playerTrans = GameObject.FindWithTag("Player").GetComponent <Transform> ();
        }

        spawns = new IndexStack <SpawnObject> (new SpawnObject[max_spawns + 20]);
        StartCoroutine(FullPullSpawn());
        StartCoroutine(MaintainSpawns());
    }
Esempio n. 13
0
    // Use this for initialization
    void Awake()
    {
        vxe       = VoxelExtractionPointCloud.Instance;
        chunkObjs = vxe.chunkGameObjects;

        num_chunks_x = vxe.num_chunks_x;
        num_chunks_y = vxe.num_chunks_y;
        num_chunks_z = vxe.num_chunks_z;

        biomeOccupiedChunks = new IndexStack <Vec3Int> [activeBiomes];
        for (int i = 0; i < activeBiomes; i++)
        {
            biomeOccupiedChunks[i] = new IndexStack <Vec3Int>(new Vec3Int[1000]);
        }

        initBiomes();
    }
Esempio n. 14
0
    // Use this for initialization
    void Start()
    {
        //Initialize VBariables
        biome = BiomeScript.Instance;
        vxe = VoxelExtractionPointCloud.Instance;
        mybiome = biome.biomeArea [0].biome;
        au_source = GetComponent<AudioSource> ();
        if (playerTrans == null)
            playerTrans = GameObject.FindWithTag ("Player").GetComponent<Transform> ();

        /*playerCC = vxe.getChunkCoords (playerTrans.position);
        mybiome = biome.biomeMap [playerCC.x, playerCC.z];
        prevBiome = mybiome;
        switchBiomeAudio (mybiome);
        */
        StartCoroutine (waitToInitialize ());
    }
Esempio n. 15
0
    // Use this for initialization
    void Start()
    {
        StartCoroutine(findFloor());
        foreach (BiomeSpawn bm in currentBiomeSpawn)
        {
            spawnTable.Add(bm.biome, bm);
        }
        vxe           = VoxelExtractionPointCloud.Instance;
        biome         = BiomeScript.Instance;
        thingsSpawned = new List <GameObject> ();

        if (playerTrans == null)
        {
            playerTrans = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform> ();
        }
        //Debug Test for whether to use ActiveInHiearchy vs ActiveSelf
        //Debug.Log (string.Format ("Portal Active In Hiearchay {0} , Portal Active Self {1} ", portal.activeInHierarchy, portal.activeSelf));
    }
Esempio n. 16
0
    // Use this for initialization
    void Start()
    {
        //Initialize VBariables
        biome     = BiomeScript.Instance;
        vxe       = VoxelExtractionPointCloud.Instance;
        mybiome   = biome.biomeArea [0].biome;
        au_source = GetComponent <AudioSource> ();
        if (playerTrans == null)
        {
            playerTrans = GameObject.FindWithTag("Player").GetComponent <Transform> ();
        }

        /*playerCC = vxe.getChunkCoords (playerTrans.position);
         * mybiome = biome.biomeMap [playerCC.x, playerCC.z];
         * prevBiome = mybiome;
         * switchBiomeAudio (mybiome);
         */
        StartCoroutine(waitToInitialize());
    }
Esempio n. 17
0
    // Use this for initialization
    void Start()
    {
        vxe = VoxelExtractionPointCloud.Instance;
        overlayInstances = new GameObject[dim, dim, dim];
        for (int i = 0; i < dim; i++)
        {
            for (int j = 0; j < dim; j++)
            {
                for (int k = 0; k < dim; k++)
                {
                    Mesh mesh = new Mesh();
                    mesh.vertices = ChunkTemplate.Instance.vertices;
                    //mesh.normals = ChunkTemplate.Instance.normals;
                    //mesh.uv = ChunkTemplate.Instance.uvs;
                    mesh.colors32 = ChunkTemplate.Instance.colors;

                    overlayInstances [i, j, k] = Instantiate(overlay);
                    overlayInstances [i, j, k].GetComponent <MeshFilter>().mesh = mesh;
                    overlayInstances [i, j, k].transform.parent = transform;
                }
            }
        }
        overlay.SetActive(false);
    }
Esempio n. 18
0
    protected virtual void Start()
    {
        mycollider = GetComponent<BoxCollider> ();
        audioSource = GetComponent<AudioSource> ();

        vxe = VoxelExtractionPointCloud.Instance;
        partsys.enableEmission = true;

        if (camera == null)
            camera = vxe.camera;

        if (partsys.isPlaying)
            partsys.Stop ();

        if (switches.Length < 1)
            InitSwitches ();

        num_switch = switches.Length;
        num_triggered = 0;

        for (int i=0; i< num_switch; i++) {
            switches [i].vparent = this;
        }
    }
Esempio n. 19
0
 void Awake()
 {
     mycollider = GetComponent<BoxCollider> ();
     myrenderer = GetComponent<MeshRenderer> ();
     vxe = VoxelExtractionPointCloud.Instance;
 }
Esempio n. 20
0
 // Use this for initialization
 void Start()
 {
     allMask = leftCam.cullingMask;
     noMask = backCam.cullingMask;
     //myAnim = GetComponent<Animator> ();
     //leftCam.cullingMask = noMask;
     //rightCam.cullingMask = noMask;
     //if (!VRmode) {
     backCam.cullingMask = allMask;
     backCam.clearFlags = CameraClearFlags.Skybox;
     backCam.GetComponent<AudioListener> ().enabled = true;
     leftCam.gameObject.SetActive (false);
     rightCam.gameObject.SetActive (false);
     canvas.worldCamera = backCam;
     //canvas [1].gameObject.SetActive (false);
     //}
     headsetImage.SetActive (false);
     vxe = VoxelExtractionPointCloud.Instance;
     //StartCoroutine (runitPreScanMessage ());
     UpdatePreScanMessage ();
 }
Esempio n. 21
0
    // Use this for initialization
    void Start()
    {
        vxe = VoxelExtractionPointCloud.Instance;
        biome = BiomeScript.Instance;
        mybiome = biome.biomeArea [0].biome;
        occupiedNearMe = new List<Chunks> ();
        assetChunkTable = new Dictionary<Vec3Int, GameObject> ();

        if (playerTrans == null)
            playerTrans = GameObject.FindWithTag ("Player").GetComponent<Transform> ();

        InitializeEnvironmentBiome (ref desertGameObjects, "DesertAssets", ref desertAssets);
        InitializeEnvironmentBiome (ref grassGameObjects, "GrassAssets", ref grassAssets);
        InitializeEnvironmentBiome (ref IceGameObjects, "IceAssets", ref iceAssets);
        InitializeEnvironmentBiome (ref marshGameObjects, "MarshAssets", ref marshAssets);
        spawns = new IndexStack<SpawnObject> (new SpawnObject[max_spawns]);
        StartCoroutine (FullPullSpawn ());
        StartCoroutine (MaintainSpawns ());
    }
    // Use this for initialization
    void Start()
    {
        vxe = VoxelExtractionPointCloud.Instance;
        myAnim = GetComponent<Animator> ();
        auSource = GetComponent<AudioSource> ();
        screenFadeScript = playerTrans.GetComponent<ScreenFade> ();
        playerGazeScript = playerTrans.GetComponent<TutorialGaze> ();

        pocketWatch = pWatchPokeScript.gameObject;
        pWatchPokeScript.enabled = false;
        SetMeshRenderersInChildren (pocketWatch, false);

        auSource.pitch = 0.75f;
        TheSheepDog.transform.position = watchTrans.position;

        tutorialPhase = TutorialPhase.SetUpHypno;
        SetMeshRenderersInChildren (tutorialSheep, false);
        //Disable for now, will use GazeTutorial Later
        //SetMeshRenderersInChildren (gazeTutorialGameObjects, false);
        SetMainGameObjects (false);
    }
Esempio n. 23
0
    //float minDistSqr;

    void Awake()
    {
        vxe = VoxelExtractionPointCloud.Instance;
    }
Esempio n. 24
0
 protected virtual void Awake()
 {
     vxe = VoxelExtractionPointCloud.Instance;
 }
Esempio n. 25
0
 protected virtual void Awake()
 {
     vxe = VoxelExtractionPointCloud.Instance;
 }
Esempio n. 26
0
 //float minDistSqr;
 void Awake()
 {
     vxe = VoxelExtractionPointCloud.Instance;
 }
Esempio n. 27
0
 void Awake()
 {
     mycollider = GetComponent <BoxCollider> ();
     myrenderer = GetComponent <MeshRenderer> ();
     vxe        = VoxelExtractionPointCloud.Instance;
 }
Esempio n. 28
0
 // Use this for initialization
 void Start()
 {
     vxe = VoxelExtractionPointCloud.Instance;
     init();
 }
Esempio n. 29
0
 // Use this for initialization
 void Start()
 {
     vxe = VoxelExtractionPointCloud.Instance;
     init();
 }
Esempio n. 30
0
 // Use this for initialization
 void Start()
 {
     myTrans   = GetComponent <Transform> ();
     cubeTrans = cubeswitch.gameObject.transform;
     vxe       = VoxelExtractionPointCloud.Instance;
 }
Esempio n. 31
0
 void Start()
 {
     vxe     = VoxelExtractionPointCloud.Instance;
     spawned = false;
 }
Esempio n. 32
0
 void Start()
 {
     vxe = VoxelExtractionPointCloud.Instance;
     partsys.Stop ();
     //cubeswitch.gameObject.SetActive (false);
 }
Esempio n. 33
0
 // Use this for initialization
 void Start()
 {
     myTrans = GetComponent<Transform> ();
     cubeTrans = cubeswitch.gameObject.transform;
     vxe = VoxelExtractionPointCloud.Instance;
 }
    // Use this for initialization
    void Start()
    {
        vxe = VoxelExtractionPointCloud.Instance;
        myAnim = GetComponent<Animator> ();
        auSource = GetComponent<AudioSource> ();
        screenFadeScript = playerTrans.GetComponent<ScreenFade> ();
        playerGazeScript = playerTrans.GetComponent<TutorialGaze> ();

        pocketWatch = pWatchPokeScript.gameObject;
        pWatchPokeScript.enabled = false;
        SetMeshRenderersInChildren (pocketWatch, false);

        auSource.pitch = 0.75f;

        biome.setAllMaterials (biome.fadedMaterials [0]);
        tutorialPhase = TutorialPhase.SetUpHypno;
        #if GazeTut
        SetMeshRenderersInChildren (tutorialSheep, false);
        #endif
        //Disable for now, will use GazeTutorial Later
        //SetMeshRenderersInChildren (gazeTutorialGameObjects, false);
        SetMainGameObjects (false);
        audioCueManager.playAudioClip (audioCueManager.lookForPocketWatch);
    }
Esempio n. 35
0
 void Start()
 {
     vxe = VoxelExtractionPointCloud.Instance;
     spawned = false;
 }
Esempio n. 36
0
 // Use this for initialization
 void Start()
 {
     ai_state = AI_STATE.STOPPED;
     vxe = VoxelExtractionPointCloud.Instance;
     itemspawn = ItemSpawner.Instance;
     lastposition = new Vector3 ();
     stepdownThreshold = vxe.voxel_size * 2;
     stepdownThreshold = stepdownThreshold * stepdownThreshold;
     playerFaceThreshold = vxe.voxel_size * 7;
     //init ();
 }
Esempio n. 37
0
    // Use this for initialization
    void Start()
    {
        StartCoroutine (findFloor ());
        foreach (BiomeSpawn bm in currentBiomeSpawn) {
            spawnTable.Add (bm.biome, bm);
        }
        vxe = VoxelExtractionPointCloud.Instance;
        biome = BiomeScript.Instance;
        thingsSpawned = new List<GameObject> ();

        if (playerTrans == null)
            playerTrans = GameObject.FindGameObjectWithTag ("Player").GetComponent<Transform> ();
        //Debug Test for whether to use ActiveInHiearchy vs ActiveSelf
        //Debug.Log (string.Format ("Portal Active In Hiearchay {0} , Portal Active Self {1} ", portal.activeInHierarchy, portal.activeSelf));
    }