public void PushPower(NetMsg msg) { PushPower data = msg.pshPower; GameRoot.Instance.SetPlayerPower(data.power); if (_mainCityWnd.gameObject.activeSelf) { _mainCityWnd.RefreshUI(); } }
public virtual void Push(Vector3 direction, PushPower force, float?distance) { Vector3 forceDirection = new Vector3(direction.x, 0, direction.z); if (distance != null) { float newDistance = Mathf.Clamp((float)distance, 0, 10); float remappedDistance = MathHelper.RemapValue(newDistance, 0, 10, 2, 0); //Debug.Log("New distance: " + newDistance + ", remappedDistance: " + remappedDistance + ", Real Distance: " + ((float) distance)); forceDirection *= remappedDistance / 3; } this.transform.position += forceDirection; }
public override void Push(Vector3 direction, PushPower force, float?distance = null) { this.navMeshAgent.enabled = false; //base.Push(direction, force, distance); this.hurtEffect.Enable(); if (this.healthManager.IsHurt()) { this.target = this.healthManager.source.transform; this.OnHurt(); } this.pushTimer.StartTimer(() => { this.navMeshAgent.enabled = true; if (!stopped) { this.navMeshAgent.SetDestination(this.destination); } }); }
void Awake() { PushPower.sharedInstance = this; }
/// <summary> /// 根据恢复体力值 /// </summary> public void UpdataPlayerDataByPushPower(PushPower pushPower) { playerDate.power = pushPower.power; }
public void Push(Vector3 direction, PushPower force, float?distance) { this.movement.Push(direction, force, distance); }