プレイヤのコア
Наследование: UnityEngine.MonoBehaviour, IAttacker, IDamageable
Пример #1
0
        void Start()
        {
            var input = GetComponent<IPlayerInput>();
            core = GetComponent<PlayerCore>();

            AttackObservable = DebugSceneMarker.Instance == null
                ? input.OnAttackButtonObservable
                    .SkipUntil(GameState.Instance.GameStateReactiveProperty.Where(x => x == GameStateEnum.GameUpdate))
                    .TakeUntil(core.OnPlayerDeadAsObservable)
                : input.OnAttackButtonObservable.TakeUntil(core.OnPlayerDeadAsObservable);

            //デフォルト装備
            SwitchWeapon(DefaultWeaponPrefab);

            core.OnPickUpItemObservable
                .TakeUntil(core.OnPlayerDeadAsObservable)
                .OfType(default(WeaponItemType))
                .Subscribe(x =>
                {
                    var waeponObject = WeaponProvider.Instance.GetWeaponPrefab(x.ItemType);
                    SwitchWeapon(waeponObject);
                });

        }
        public ResultInfo(PlayerCore core, float time)
        {

            PlayerCore = core;
            DeadTime = time;
        }