private void AllAwake() { State = new CharacterState(); StateTransfer = new StateTransfer(_initState, _animator); Location = (IPlayerLocation) new Location(this); Location.InitializeFoot(_footCollider); Location.InitializeCenter(_centerCollider); Debuff = new Debuff(transform); Debuff.Register(DebuffType.Stun, _stunEffect); Debuff.Register(DebuffType.Heavy, _heavyEffect); Debuff.Register(DebuffType.Slow, _slowEffect); Stream = new PlayerStream(); Synchronizer.SetStream(Stream); Character = new Character2D(this); Stream.OnAnimationUpdated .Subscribe(state => StateTransfer.TransitTo(state)) .AddTo(gameObject); if (!PhotonView.isMine) { AudioEnvironment.DisableListener(); } }
public void SetStream(PlayerStream stream) { _stream = stream; }