public void ChangePlayerFacing(Direction direction, HeadFacing headFacing) { var msg = client.CreateMessage(); msg.Write((byte)PacketType.LookTowards); msg.Write((byte)direction); msg.Write((byte)headFacing); client.SendMessage(msg, NetDeliveryMethod.ReliableOrdered); }
public void SetHeadFacing(HeadFacing facing) { if (CurrentMotion != SpriteMotion.Sit && CurrentMotion != SpriteMotion.Idle) { return; } HeadFacing = facing; currentFrame = (int)HeadFacing; isDirty = true; }
override public void SetHeadTurnTarget(Vector3 position, bool isInstant, HeadFacing _headFacing = HeadFacing.Manual) { if (_headFacing == HeadFacing.Hotspot && lockHotspotHeadTurning) { ClearHeadTurnTarget(HeadFacing.Hotspot, false); } else { base.SetHeadTurnTarget(position, isInstant, _headFacing); } }
public void ChangeMotion(SpriteMotion nextMotion, bool forceUpdate = false) { //Debug.Log($"{name} state {State} change motion from {CurrentMotion} to {nextMotion}"); if (CurrentMotion == nextMotion && !forceUpdate) { return; } CurrentMotion = nextMotion; currentFrame = 0; if (!isInitialized) { return; } var action = RoAnimationHelper.GetMotionIdForSprite(Type, nextMotion); if (action < 0 || action > SpriteData.Actions.Length) { action = 0; } ChangeAction(action); isPaused = false; isDirty = true; if (Type == SpriteType.Player) { if (CurrentMotion == SpriteMotion.Idle || CurrentMotion == SpriteMotion.Sit) { currentFrame = (int)HeadFacing; UpdateSpriteFrame(); isPaused = true; } else { HeadFacing = HeadFacing.Center; } } if (Shadow != null) { if (CurrentMotion == SpriteMotion.Sit || CurrentMotion == SpriteMotion.Dead) { Shadow.SetActive(false); } else { Shadow.SetActive(true); } } }
public void Reset() { Entity = EcsEntity.Null; Target = EcsEntity.Null; Character = null; CombatEntity = null; Connection = null; CurrentCooldown = 0f; HeadId = 0; HeadFacing = HeadFacing.Center; IsMale = true; QueueAttack = false; }
public void ChangeLookDirection(ref EcsEntity entity, Direction direction, HeadFacing facing) { if (State == CharacterState.Moving || State == CharacterState.Dead) { return; } FacingDirection = direction; var player = entity.Get <Player>(); if (player != null) { player.HeadFacing = facing; } Map.GatherPlayersForMultiCast(ref entity, this); CommandBuilder.ChangeFacingMulti(this); CommandBuilder.ClearRecipients(); }
/** * <summary>Controls the head-facing position.</summary> * <param name = "_headTurnTarget">The Transform to face</param> * <param name = "_headTurnTargetOffset">The position offset of the Transform</param> * <param name = "isInstant">If True, the head will turn instantly</param> * <param name = "_headFacing">What the head should face (Manual, Hotspot, None)</param> */ public override void SetHeadTurnTarget(Transform _headTurnTarget, Vector3 _headTurnTargetOffset, bool isInstant, HeadFacing _headFacing = HeadFacing.Manual) { if (_headFacing == HeadFacing.Hotspot && lockHotspotHeadTurning) { ClearHeadTurnTarget(false, HeadFacing.Hotspot); } else { base.SetHeadTurnTarget(_headTurnTarget, _headTurnTargetOffset, isInstant, _headFacing); } }
/** * <summary>Controls the head-facing position.</summary> * <param name = "position">The point in World Space to face</param> * <param name = "isInstant">If True, the head will turn instantly</param> * <param name = "_headFacing">What the head should face (Manual, Hotspot, None)</param> */ public override void SetHeadTurnTarget(Vector3 position, bool isInstant, HeadFacing _headFacing = HeadFacing.Manual) { if (_headFacing == HeadFacing.Hotspot && lockHotspotHeadTurning) { ClearHeadTurnTarget (false, HeadFacing.Hotspot); } else { base.SetHeadTurnTarget (position, isInstant, _headFacing); } }
public virtual void SetHeadTurnTarget(Vector3 position, bool isInstant, HeadFacing _headFacing = HeadFacing.Manual) { if (_headFacing == HeadFacing.Hotspot && headFacing == HeadFacing.Manual) { // Don't look at Hotspots if manually-set return; } headTurnTarget = position; headFacing = _headFacing; if (isInstant) { CalculateHeadTurn (); SnapHeadMovement (); } }
public void ClearHeadTurnTarget(bool isInstant) { headFacing = HeadFacing.None; if (isInstant) { targetHeadAngles = Vector2.zero; SnapHeadMovement (); } }
public void ClearHeadTurnTarget(HeadFacing _headFacing, bool isInstant) { if (headFacing == _headFacing) { ClearHeadTurnTarget (isInstant); } }
private void OnLevelWasLoaded() { headFacing = HeadFacing.None; lockDirection = false; lockScale = false; isLipSyncing = false; lipSyncShapes.Clear (); ReleaseSorting (); }
/** * <summary>Controls the head-facing position.</summary> * <param name = "_headTurnTarget">The Transform to face</param> * <param name = "_headTurnTargetOffset">The position offset of the Transform</param> * <param name = "isInstant">If True, the head will turn instantly</param> * <param name = "_headFacing">What the head should face (Manual, Hotspot, None)</param> */ public override void SetHeadTurnTarget(Transform _headTurnTarget, Vector3 _headTurnTargetOffset, bool isInstant, HeadFacing _headFacing = HeadFacing.Manual) { if (_headFacing == HeadFacing.Hotspot && lockHotspotHeadTurning) { ClearHeadTurnTarget (false, HeadFacing.Hotspot); } else { base.SetHeadTurnTarget (_headTurnTarget, _headTurnTargetOffset, isInstant, _headFacing); } }