public GameObject GetStationResource() { // get the resource associated with this station!!! YellOnClaim myYellOnClaim = this.gameObject.GetComponent <YellOnClaim>(); DictionariesForThings d = this.gameObject.GetComponent <DictionariesForThings>(); return(d.GetResourceFromLocation(myYellOnClaim.currentLocation)); }
public void LevelUpCards()// special case for cards on level up { YellOnClaim myYellOnClaim = this.gameObject.GetComponent <YellOnClaim>(); foreach (GameObject card in myLevelUpResourceCards) { StampCard myStampCard = card.GetComponent <StampCard>(); } }
private void OnMouseDown() { if (this.myYellOnClaim.MyCurrentToy != null) { if (this.myYellOnClaim == null) { this.myYellOnClaim = GameObject.Find("DebugLog").GetComponent <YellOnClaim>();//hack since these are instances? } //Debug.Log("Resource type is: " + this.ResourceType); //if this toy does have the resource to the toy int resourceCounttemp = this.myYellOnClaim.MyCurrentToy.customData.GetInt(this.ResourceType, -999); if (resourceCounttemp == -999) { this.myYellOnClaim.MyCurrentToy.customData.AddInt(this.ResourceType, 1); resourceCounttemp = 1; } else { this.myYellOnClaim.MyCurrentToy.customData.SetInt(this.ResourceType, ++resourceCounttemp); } if (myYellOnClaim.resourceCountForText.ContainsKey(ResourceType)) { myYellOnClaim.resourceCountForText[ResourceType]++; } else { myYellOnClaim.resourceCountForText.Add(ResourceType, 1); } Instantiate(particles, gameObject.GetComponentInParent <ParticleSpawn>().particlespawn.position, Quaternion.identity); AudioSource.PlayClipAtPoint(soundeffect, Vector3.zero); Debug.Log("Collected: " + this.ResourceType + " Currently have: " + resourceCounttemp); this.mySpawner.OnCollectedResource();// this.gameObject.SetActive(false); } }
public List <KeyValuePair <string, int> > GetQuestData() { List <KeyValuePair <string, int> > ret = new List <KeyValuePair <string, int> >(); YellOnClaim myYellOnClaim = this.gameObject.GetComponent <YellOnClaim>(); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.FARM], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.FARM], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.WIND], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.WIND], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.LAKE], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.LAKE], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.FOREST], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.FOREST], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.MOUNTAIN], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.MOUNTAIN], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.SWAMP], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.SWAMP], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.ORCHARD], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.ORCHARD], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.HUNTING], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.HUNTING], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.MARKET], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.MARKET], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.LUMBER], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.LUMBER], -1))); ret.Add(new KeyValuePair <string, int>(Location2ResourceDic[YellOnClaim.Location.SANC2], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.SANC2], -1))); // ret.Add(new KeyValuePair<string, int>(Location2ResourceDic[YellOnClaim.Location.SANC], myYellOnClaim.MyCurrentToy.customData.GetInt(Location2ResourceDic[YellOnClaim.Location.SANC], -1))); return(ret); }