public override void parserAttributes(Hashtable attributesTable, HazardDef.HazardType hazardType) { type = hazardType; int puDelay = int.Parse(attributesTable["delay"] as string); int puRepeat = int.Parse(attributesTable["repeat"] as string); string puBuffType = attributesTable["bufftype"] as string; int puBuffValue = int.Parse(attributesTable["buffvalue"] as string); int puBuffDurTime = int.Parse(attributesTable["bufftime"] as string); ArrayList posArrList = attributesTable["rangepos"] as ArrayList; List<Vector2> rangePosList = new List<Vector2>(); for(int i = 0;i < posArrList.Count;i++){ string[] posStr = posArrList[i].ToString().Split(','); Vector2 v2 = new Vector2(float.Parse(posStr[0]),float.Parse(posStr[1])); rangePosList.Add(v2); } PowerUpDef powerupDef = new PowerUpDef(); powerupDef.puDelay = puDelay; powerupDef.puRepeat = puRepeat; powerupDef.puBuffType = puBuffType; powerupDef.puBuffValue = puBuffValue; powerupDef.puBuffDurTime = puBuffDurTime; powerupDef.puRangePosList = rangePosList; this.powerupDef = powerupDef; }
public override void parserAttributes(Hashtable attributesTable, HazardDef.HazardType hazardType) { attackSpeed = float.Parse(attributesTable["aspd"] as string); attack = float.Parse(attributesTable["atk"] as string); base.parserAttributes(attributesTable, hazardType); }
public virtual void parserAttributes(Hashtable attributesTable, HazardDef.HazardType hazardType) { type = hazardType; string[] strPos = (attributesTable["pos"] as string).Split(','); position = new Vector2(float.Parse(strPos[0]), float.Parse(strPos[1])); }
public override void parserAttributes(Hashtable attributesTable, HazardDef.HazardType hazardType) { type = hazardType; attackSpeed = float.Parse(attributesTable["aspd"] as string); attack = float.Parse(attributesTable["atk"] as string); SentryGunY = float.Parse(attributesTable["SentryGunY"] as string); string[] strPos = (attributesTable["FrontSightPos"] as string).Split(','); frontSightPos = new Vector2(float.Parse(strPos[0]), float.Parse(strPos[1])); // base.parserAttributes(attributesTable); }
public override void parserAttributes(Hashtable attributesTable, HazardDef.HazardType hazardType) { type = hazardType; float attackSpeed = float.Parse(attributesTable["aspd"] as string); float attack = float.Parse(attributesTable["atk"] as string); ArrayList energyPolePosList = attributesTable["polePos"] as ArrayList; for(int i = 0; i < energyPolePosList.Count; i++) { string[] energyPolePosStr = energyPolePosList[i].ToString().Split(','); Vector2 p = new Vector2(float.Parse(energyPolePosStr[0]), float.Parse(energyPolePosStr[1])); EnergyPoleDef ep = new EnergyPoleDef(); ep.attack = attack; ep.attackSpeed = attackSpeed; ep.localPosition = p; energyPoleList.Add(ep); } }
protected Hazard createHazard(GameObject go, HazardDef hazardDef) { string resStr = "gsl_Cell/" + hazardDef.Type; if(hazardDef.Type == HazardDef.HazardType.EnergyPole || hazardDef.Type == HazardDef.HazardType.PowerUp) { resStr += "Manager"; } GameObject prefab = Resources.Load(resStr) as GameObject; GameObject decor = Instantiate(prefab) as GameObject; decor.transform.parent = go.transform; Hazard hazard = decor.GetComponent<Hazard>(); if(hazard != null) { float xx = Mathf.Lerp(-Utils.getScreenLogicWidth()/2f,Utils.getScreenLogicWidth()/2f,(1+hazardDef.Position.x)/2f); float yy = Mathf.Lerp(-Utils.getScreenLogicHeight()/2f,Utils.getScreenLogicHeight()/2f,(1+hazardDef.Position.y)/2f); hazard.transform.localPosition = new Vector3(xx, yy, 0); //hazard.transform.localPosition = new Vector3( hazardDef.Position.x,hazardDef.Position.y,0); hazard.HazardDef = hazardDef; } return hazard; }