private void Start() { statsComponent = GetComponent <Stats.StatsComponent>(); moveState = new ProxyNetworkWalkMoveState(); moveState.OnStateEnter(transform); }
internal void DetachMoveState(bool destroyEntity) { if (moveEntity == null) { return; } if (unit.IsOwner) { moveState.RemoveCallback(nameof(IUnitState.MovementFlags), OnMoveStateFlagsChanged); } if (destroyEntity) { if (!moveEntity.IsOwner || !moveEntity.IsAttached) { Destroy(moveEntity.gameObject); } else { BoltNetwork.Destroy(moveEntity.gameObject); } } moveEntity = null; moveState = null; }
public void DetachMoveState(bool destroyObject) { if (clientMoveEntity == null) { return; } if (Unit.IsOwner) { clientMoveState.RemoveCallback(nameof(IUnitState.MovementFlags), OnLocalMoveStateFlagsChanged); } if (destroyObject) { if (!clientMoveEntity.IsOwner || !clientMoveEntity.IsAttached) { Object.Destroy(clientMoveEntity.gameObject); } else { BoltNetwork.Destroy(clientMoveEntity.gameObject); } } clientMoveEntity = null; clientMoveState = null; }
IEnumerator OverfenchToGroundMove(float seconds) { _blockRotationPlayer = false; State = new GroundState(this); controller.enabled = true; yield return(new WaitForSeconds(seconds)); anim.speed = 1; _blockRotationPlayer = true; }
public void AttachMoveState(BoltEntity moveEntity) { clientMoveEntity = moveEntity; clientMoveState = moveEntity.GetState <IMoveState>(); clientMoveState.SetTransforms(clientMoveState.LocalTransform, moveEntity.transform); if (Unit.IsOwner) { clientMoveState.AddCallback(nameof(IUnitState.MovementFlags), OnLocalMoveStateFlagsChanged); } }
internal void AttachMoveState(BoltEntity moveEntity) { this.moveEntity = moveEntity; moveState = moveEntity.GetState <IMoveState>(); moveState.SetTransforms(moveState.LocalTransform, moveEntity.transform); if (unit.IsOwner) { moveState.AddCallback(nameof(IUnitState.MovementFlags), OnMoveStateFlagsChanged); } }
public void HandeInput(InputDown inputDown) { IMoveState moveState = _moveState.HandleInput(this, inputDown); if (moveState != null) { _moveState.Exit(this); _moveState = moveState; _moveState.Enter(this); } _moveState.Update(this); }
IEnumerator FenceClimbCoroutine(float seconds) { anim.applyRootMotion = true; anim.SetFloat("InputManitide", 0); anim.SetTrigger("UpOnWall"); yield return(new WaitForEndOfFrame()); anim.SetBool("isGrounded", true); yield return(new WaitForSeconds(seconds)); State = new GroundState(this); controller.enabled = true; }
private void Update() { if (moveState == null) { Debug.LogWarning("UpdateMoveState: No move state!"); return; } IMoveState nextState = null; nextState = moveState.StateUpdate(transform, proxyVelocity, null, ref proxyVelocity, ref proxyRotation); if (nextState != null) { moveState.OnStateExit(); moveState = nextState; moveState.OnStateEnter(transform); } }
// Use this for initialization void Start() { input = GetComponent<PlayerInputController>(); controller = GetComponent<CharacterController>(); walkstate = new WalkState(this , PathLines); jumpState = new JumpState(this); fallState = new FallState(this); currentState = walkstate; currentState.enter_State(); animator = GetComponent<Animator>(); targetPath = PathLines[1]; changePath = false; }
public void ChangeState(IMoveState moveState) { this.moveState = moveState; this.moveState.InitState(); }
public Movement() { State = new GroundState(this); }
public void InitMoveState(IMoveState moveState) { _moveState = moveState; }