public void UpdateProperty() { this.attack = 0; this.def = 0; this.speed = 0; Ei headgearItem = headgear.GetComponentInChildren <Ei> (); PlusProperty(headgearItem); Ei accessoryItem = accessory.GetComponentInChildren <Ei> (); PlusProperty(accessoryItem); Ei armorItem = armor.GetComponentInChildren <Ei> (); PlusProperty(armorItem); Ei leftHandItem = leftHand.GetComponentInChildren <Ei> (); PlusProperty(leftHandItem); Ei rightHandItem = rightHand.GetComponentInChildren <Ei> (); PlusProperty(rightHandItem); Ei shoeItem = shoe.GetComponentInChildren <Ei> (); PlusProperty(shoeItem); Status._instance.UpdateShow(); }
public bool Dress(int id, GameObject gO) { ObjectsInfo info = ObjectInfo._instance.GetOjectInfoById(id); if (info.type != ObjectType.Equip) { return(false); } else if (info.applicationType != pStatus.apType && info.applicationType != ApplicationType.Common) { return(false); } else { GameObject parent = null; switch (info.dressType) { case DressType.Accessory: parent = accessory; break; case DressType.Armor: parent = armor; break; case DressType.Shoe: parent = shoe; break; case DressType.Headgear: parent = headgear; break; case DressType.LeftHand: parent = leftHand; break; case DressType.RightHand: parent = rightHand; break; } Ei ei = parent.GetComponentInChildren <Ei>(); if (ei == null) { GameObject itemGo = NGUITools.AddChild(parent, EquipItem); itemGo.transform.localPosition = Vector3.zero; itemGo.GetComponent <Ei>().SetInfo(info); gO.GetComponentInParent <InventoryItemgrid>().ClearInfo(); GameObject.Destroy(gO); } else { oldId = ei.id; ei.SetInfo(info); isExchange = true; } return(true); } }
/// <summary> /// Recepción de datos del puerto serial enviados por arduino /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e) { //-------------------------Recepción de datos del arduino------------------------------ _bufferint = serialPort1.ReadLine(); //-------------Convirtiendo valores recibidos a datos tipo double------------------ bool valnum1 = double.TryParse(_bufferint, out _data1); //-------------------Muestreo de datos para filtrar errores de medición------------- if (valnum1) // Validando que el dato recibido sea un número { _dataHcsr04 = _data1; ErrorIntegral(_dataHcsr04 * 0.017); _sumHcsr04 = _sumHcsr04 + _dataHcsr04; _contador++; } //--------------Promediando datos del muestreo y calculando distancias------------------ if (_contador == 29) { _promHcsr04 = _sumHcsr04 / 30; _contador = 0; _sumHcsr04 = 0; _sumTime = 0; _distanceHcsr04 = _promHcsr04 * 0.017; ErrorProporcional(_distanceHcsr04); ErrorDerivativo(_distanceHcsr04); //-------------Mandando distancia sensada por el sensor al monitor------------------ BufferContentHcsr04(Math.Round(_distanceHcsr04, 1).ToString()); BufferOutEp(Ep.ToString()); BufferOutEint(Ei.ToString()); BufferOutEderiv(Ed.ToString()); BufferOutPwm(_pwmPid.ToString()); //-----------------Envio de datos al arduino y graficación--------------------------- serialPort1_SenddataProportional(_distanceHcsr04); Updategraph(i++, _distanceHcsr04); serialPort1.DiscardInBuffer(); //-----------------Añadiendo datos a lista para su ingreso al excel------------------- Posiciones.Add(_distanceHcsr04); Errores.Add(Ep); if (i > 100) { i = 0; } } }
void PlusProperty(Ei ei) { if (ei != null) { ObjectsInfo info = ObjectInfo._instance.GetOjectInfoById(ei.id); if (info == null) { } else { this.attack += info.attack; this.def += info.def; this.speed += info.speed; } } }
void Awake() { parent = this.GetComponentInParent <EiGrid> (); ei = this.GetComponent <Ei> (); }
private void bemalteEierCB(XcoQueue<Ei> source, Ei entry) { this.Invoke(new Action(() => { textBox3.AppendText(entry.ToString() + " bemalt" + Environment.NewLine); })); }
public virtual void ReturnBemaltesEi(Ei ei) { }
private void bemalteEierCB(XcoQueue<Ei> source, Ei entry) { this.Invoke(new Action(() => { textBox3.AppendText(entry.ToString() + " bemalt" + Environment.NewLine); })); }