void Awake()
        {
            Status = GetComponent <FlyCharacterStatus>();
            Action = GetComponent <FlyCharacterAction>();

            col = GetComponent <CapsuleCollider>();
        }
        override protected void Start()
        {
            base.Start();
            InputEventProvider.X_Button.DistinctUntilChanged().Subscribe(x => { if (x)
                                                                                {
                                                                                    Attack1();
                                                                                }
                                                                         });
            InputEventProvider.Y_Button.DistinctUntilChanged().Subscribe(x => { if (x)
                                                                                {
                                                                                    Attack2();
                                                                                }
                                                                         });
            InputEventProvider.L_Button.DistinctUntilChanged().Subscribe(x => { if (x)
                                                                                {
                                                                                    Attack3();
                                                                                }
                                                                         });
            InputEventProvider.R_Button.DistinctUntilChanged().Subscribe(x => { if (x)
                                                                                {
                                                                                    Attack4();
                                                                                }
                                                                         });

            Status   = GetComponent <FlyCharacterStatus>();
            Iterator = GetComponent <Iterator>();
        }
Exemplo n.º 3
0
        void Start()
        {
            Status     = GetComponent <FlyCharacterStatus>();
            Characters = FlyCharacterManager.Instance.Characters.Where(c => c.AttackerType != Status.AttackerType).ToList();

            FlyCharacterManager.Instance.Characters.ObserveAdd()
            .Where(c => c.Value.AttackerType != Status.AttackerType)
            .Subscribe(x => Characters.Add(x.Value));

            FlyCharacterManager.Instance.Characters.ObserveRemove()
            .Where(c => c.Value.AttackerType != Status.AttackerType)
            .Subscribe(x => Characters.Remove(x.Value));
        }