Example #1
0
        private void Start()
        {
            var input = GetComponent <IPlayerInput>();

            cc       = GetComponent <CapsuleCollider>();
            core     = GetComponent <PlayerCore>();
            playerCP = GetComponent <PlayerCloudPoint>();
            rb       = GetComponent <Rigidbody>();
            jumper   = GetComponent <PlayerJumper>();

            input?.OnCreateCloudButtonObservable
            .Where(x => x)
            .Subscribe(_ => CreateCloud());
        }
Example #2
0
        private void Start()
        {
            var input = GetComponent <IPlayerInput>();

            core = GetComponent <PlayerCore>();
            var select = FindObjectOfType <MagicSelect>();

            //for (int i = 0; i < input.OnNumKeysObserabable.Length; i++)
            //attackObservable[i] = input?.OnNumKeysObserabable[i]
            //.TakeUntil(core.OnPlayerDeadAsObservable)
            //.Where(x => x && canDoMagic);


            for (int i = 0; i < 2; i++)
            {
                int f = i;
                //select?.SelectedMagics[f]
                //.Skip(1)
                //.TakeUntil(core.OnPlayerDeadAsObservable)
                //.Subscribe(x => InitMagic(MagicPrehabs.Instance.GetMagic(x), f));
            }
        }
        private void Start()
        {
            var input = GetComponent <IPlayerInput>();

            playerCP = GetComponent <PlayerCloudPoint>();
            core     = GetComponent <PlayerCore>();
            //foreach(var cloud in attackClouds)
            //{
            //    AttackCloudDictionary.Add(cloud.GetAttackCloudEnum);
            //}

            input.OnCreateAttackCloudKeybordObservable
            .ThrottleFirstFrame(0)
            .Subscribe(x => ChangeAttackCloudKeybord(x));

            input.OnSelectAttackCloudObsrvable
            .Where(v => v.magnitude != 0f)
            .Subscribe(v => ChangeAttackCloudGamePad(v));

            input.OnCreateAttackCloudObservable
            .Where(x => x && canCreateCloud)
            .Subscribe(_ => CreateAttackCloud(CloudPrehabs.Instance.AttackCloudDicitionary2[currentAttackCloud.Value]));
        }