/// <summary> /// Received when the local player is updated. /// </summary> /// <param name="localPlayer"></param> private void PlayerUpdated(NetworkIdentity localPlayer) { if (localPlayer != null) { _playerHealthPercent = localPlayer.GetComponent <HealthPercent>(); } this.enabled = (localPlayer != null); }
/// <summary> /// Received when the local player is updated. /// </summary> /// <param name="localPlayer"></param> private void PlayerUpdated(NetworkIdentity localPlayer) { if (localPlayer != null) { _playerHealthPercent = localPlayer.GetComponent <HealthPercent>(); target = localPlayer.gameObject.transform; } this.enabled = (localPlayer != null); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("DamageMultiplier", true, out subEle); subEle.Value = DamageMultiplier.ToString("G15"); ele.TryPathTo("Flags", true, out subEle); subEle.Value = Flags.ToString(); ele.TryPathTo("Type", true, out subEle); subEle.Value = Type.ToString(); ele.TryPathTo("HealthPercent", true, out subEle); subEle.Value = HealthPercent.ToString(); ele.TryPathTo("ActorValue", true, out subEle); subEle.Value = ActorValue.ToString(); ele.TryPathTo("ToHitChance", true, out subEle); subEle.Value = ToHitChance.ToString(); ele.TryPathTo("Explodable/ExplosionChance", true, out subEle); subEle.Value = ExplosionChance.ToString(); ele.TryPathTo("Explodable/DebrisCount", true, out subEle); subEle.Value = ExplosionDebrisCount.ToString(); ele.TryPathTo("Explodable/Debris", true, out subEle); ExplosionDebris.WriteXML(subEle, master); ele.TryPathTo("Explodable/Explosion", true, out subEle); Explosion.WriteXML(subEle, master); ele.TryPathTo("TrackingMaxAngle", true, out subEle); subEle.Value = TrackingMaxAngle.ToString("G15"); ele.TryPathTo("Explodable/DebrisScale", true, out subEle); subEle.Value = ExplosionDebrisScale.ToString("G15"); ele.TryPathTo("Severable/DebrisCount", true, out subEle); subEle.Value = SeverableDebrisCount.ToString(); ele.TryPathTo("Severable/Debris", true, out subEle); SeverableDebris.WriteXML(subEle, master); ele.TryPathTo("Severable/Explosion", true, out subEle); SeverableExplosion.WriteXML(subEle, master); ele.TryPathTo("Severable/DebrisScale", true, out subEle); subEle.Value = SeverableDebrisScale.ToString("G15"); ele.TryPathTo("GoreEffects/Translate/X", true, out subEle); subEle.Value = GoreEffectsTranslateX.ToString("G15"); ele.TryPathTo("GoreEffects/Translate/Y", true, out subEle); subEle.Value = GoreEffectsTranslateY.ToString("G15"); ele.TryPathTo("GoreEffects/Translate/Z", true, out subEle); subEle.Value = GoreEffectsTranslateZ.ToString("G15"); ele.TryPathTo("GoreEffects/Rotation/X", true, out subEle); subEle.Value = GoreEffectsRotationX.ToString("G15"); ele.TryPathTo("GoreEffects/Rotation/Y", true, out subEle); subEle.Value = GoreEffectsRotationY.ToString("G15"); ele.TryPathTo("GoreEffects/Rotation/Z", true, out subEle); subEle.Value = GoreEffectsRotationZ.ToString("G15"); ele.TryPathTo("Severable/ImpactDataSet", true, out subEle); SeverableImpactDataSet.WriteXML(subEle, master); ele.TryPathTo("Explodable/ImpactDataSet", true, out subEle); ExplosionImpactDataSet.WriteXML(subEle, master); ele.TryPathTo("Severable/DecalCount", true, out subEle); subEle.Value = SeverableDecalCount.ToString(); ele.TryPathTo("Explodable/DecalCount", true, out subEle); subEle.Value = ExplosionDecalCount.ToString(); WriteUnusedXML(ele, master); ele.TryPathTo("LimbReplacementScale", true, out subEle); subEle.Value = LimbReplacementScale.ToString("G15"); }
public void SetPlayerHealthPercent(HealthPercent hp) { }