public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); SpriteRenderer r = Leaves.First().GetComponent <SpriteRenderer>(); Leaves.First().transform.localPosition = startPos; //100 pixels per unit }
//Add /// <summary> /// Moves the given beast to the front of the team. /// </summary> /// <param name="beast"></param> public void MoveToFront(Beast beast) { UnityEngine.Debug.LogFormat("Moving {0} to front of team", beast.data.dataName); if (Members.Contains(beast)) { Members.Remove(beast); Members.Insert(0, beast); } }
/// <summary> /// Add an existing beast to team /// </summary> /// <param name="beast"></param> /// <returns></returns> public Team Add(Beast beast) { if (!Contains(beast)) { Members.Add(beast); } else { UnityEngine.Debug.Log("Tried to add duplicate beast to team"); } return(this); }
public string Stat; //Generic.Constants.Stat value to use public MoveType(MoveData data, Beast user) { //All info has already been validated in Generic.CustomXmlReader this.data = data; User = user; Name = data.Name; Essence = data.Essence; Focus = data.Focus; Stat = data.Stat; stateInternal = MoveState.Selected; waitInternal = Wait.None; }
public virtual void Setup(Beast beast, GameObject holder) { Textures = new List <FileInfo>(); foreach (XmlNode li in beast.data.ModelProps["textures"]) { if (File.Exists(li.InnerText)) { Textures.Add(new FileInfo(li.InnerText)); } } Pivot = this.gameObject; Pivot.transform.SetParent(holder.transform); Leaves = new List <GameObject>(); Beast = beast; }
public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); GameObject lightObject = new GameObject("Glow"); lightObject.transform.localPosition = Leaves.First().transform.localPosition; lightObject.transform.SetParent(Leaves.First().transform); int[] colors = Array.ConvertAll(beast.data.ModelProps["color"].InnerText.Split(','), int.Parse); Color color = new Color(colors[0] / 255f, colors[1] / 255f, colors[2] / 255f); float intensity = float.Parse(beast.data.ModelProps["intensity"].InnerText); Light light = lightObject.AddComponent <Light>(); light.color = color; light.intensity = intensity; //Debug.Log(lightObject.transform.localPosition); }
//Untested public bool Switch(Beast beastOut, Beast beastIn) { //UnityEngine.Debug.LogFormat("Switching out {0} for {1}", beastOut.data.dataName, beastIn.data.dataName); if (!beastIn.Equals(beastOut) && Contains(beastOut) && Contains(beastIn)) { int moveTo = Members.IndexOf(beastOut); int moveFrom = Members.IndexOf(beastIn); Members.Remove(beastOut); Members.Remove(beastIn); Members.Insert(moveTo, beastIn); Members.Insert(moveFrom, beastOut); return(true); } else { UnityEngine.Debug.LogFormat("Failed to switch {0} with {1}", beastOut, beastIn); return(false); } }
public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); GameObject leaf = GameObject.CreatePrimitive(PrimitiveType.Quad); leaf.transform.SetParent(Pivot.transform); leaf.name = this.GetType().Name; MeshRenderer r = leaf.GetComponent <MeshRenderer>(); byte[] bytes = System.IO.File.ReadAllBytes(Textures.First().FullName); Texture2D texture = new Texture2D(1, 1); texture.LoadImage(bytes); r.material = Resources.Load <Material>("BeastLeaf"); r.material.mainTexture = texture; leaf.transform.localScale = new Vector3((texture.width * 0.5f) * 0.01f, (texture.width * 0.5f) * 0.01f); leaf.transform.localPosition = new Vector3(0f, (texture.height * 0.25f) * 0.01f); //100 pixels per unit Leaves.Add(leaf); }
public float BaseDamage; //Before stat adjustments public MoveType_BasicDamage(MoveData data, Beast user) : base(data, user) { BaseDamage = float.Parse(CustomXmlReader.GetContent(data.MoveProps, "BaseDamage")); }
public MoveType_EssenceDamage(MoveData data, Beast user) : base(data, user) { BaseDamage = float.Parse(Generic.CustomXmlReader.GetContent(data.MoveProps, "BaseDamage")); DamageEssence = Generic.CustomXmlReader.GetValidContent(data.MoveProps, "DamageEssence", "Essence"); }
public bool Contains(Beast beast) => Members.Contains(beast);
public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); }