// Use this for initialization void Start() { vxe = VoxelExtractionPointCloud.Instance; biome = BiomeScript.Instance; //for (int i=0; i<spawnObjects.Length; i++) // spawnObjects[i].SetActive (false); }
// Use this for initialization protected override void Start() { base.Start (); biomeScript = BiomeScript.Instance; Vec3Int chunkCoords = vxe.getChunkCoords (transform.position); vxe.chunkGameObjects [chunkCoords.x,chunkCoords.y,chunkCoords.z].GetComponent<MeshRenderer> ().material = vxe.debugMaterial; }
// Use this for initialization protected override void Start() { base.Start(); biomeScript = BiomeScript.Instance; Vec3Int chunkCoords = vxe.getChunkCoords(transform.position); vxe.chunkGameObjects [chunkCoords.x, chunkCoords.y, chunkCoords.z].GetComponent <MeshRenderer> ().material = vxe.debugMaterial; }
private void OnCollisionEnter(Collision collision) { // move this to inside scriptable obj if (itembase is Weapon && collision.gameObject.tag == "Enemy") { //get enemy component EnemyCard enemy = collision.gameObject.GetComponent <EnemyCard>(); //cast to weapon type Weapon weapon = (Weapon)itembase; //use weapon weapon.Attack(enemy); DecreaseDurability(); } else if (collision.gameObject.tag == "Obstacle") { BiomeScript biome = collision.gameObject.GetComponent <BiomeScript>(); List <Item> drops = biome.Interact(itembase); foreach (Item drop in drops) { theInv.AddToInventory(drop); } DecreaseDurability(); } else if (itembase is Material && collision.gameObject.tag == "Pickable") { if (collision.gameObject.GetComponent <ItemScript>().GetInstanceID() > this.GetInstanceID() || !canCraft || !collision.gameObject.GetComponent <ItemScript>().canCraft) { } else { Item result; //get other component Item other = collision.gameObject.GetComponent <ItemScript>().itembase; //cast to material type Material material = (Material)itembase; if (material.Craft(other, out result)) { canCraft = false; collision.gameObject.GetComponent <ItemScript>().canCraft = false; //create from result theInv.RemoveFromInventory(collision.gameObject.GetComponent <ItemScript>().inventoryIndex); theInv.RemoveFromInventory(inventoryIndex); theInv.AddToInventory(result); } } } //Return to hand if (reset) { GetComponent <Rigidbody>().isKinematic = true; transform.localPosition = inventoryPos; reset = false; } }
// 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(); } }
// 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 ()); }
// 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()); }
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; }
// 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)); }
// 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()); }
// 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() { 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)); }
public void RemoveFromList(BiomeScript biomeCard) { biomeList.Remove(biomeCard); Destroy(biomeCard.gameObject); }
public void AddToList(BiomeScript biomeCard) { biomeList.Add(biomeCard); }