예제 #1
0
파일: Player.cs 프로젝트: moto2002/kikan
        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();
            }
        }
예제 #2
0
        void Awake()
        {
            Movement = new EnemyMovement();
            Movement.SetMoveForce(Spd);
            Movement.SetJumpForce(400.0f);
            State         = new CharacterState();
            StateTransfer = new StateTransfer(_initState, _animator);
            Hp            = new Hp(_enemyData.Hp);
            Debuff        = new Debuff(transform);
            Debuff.Register(DebuffType.Stun, _stunEffect);
            Debuff.Register(DebuffType.Heavy, _heavyEffect);
            Debuff.Register(DebuffType.Slow, _slowEffect);
            Debuff.Register(DebuffType.Slip, _slipEffect);
            Debuff.Register(DebuffType.Ice, _iceEffect);

            FixSpd = new ReactiveCollection <FixSpd>();

            Location = (IEnemyLocation) new Location(this);
            Location.InitializeFoot(_footCollider);

            DamageReactor = new DamageReactor(this);
            DamageReactor.SetSlot(new LevelResistance(_level));

            Character = new Character2D(this);
        }