public async Task API_HealthCheckTest()
        {
            var widget  = new TestWidget();
            var handler = new CheckHealth();
            var request = HealthCheckRequest.Create(widget);

            await handler.Handle(request, CancellationToken.None);
        }
    public LocalLiveNodeActor(
        Node node,
        IClusterSnapshot snapshot,
        IRegistry registry,
        IOperationalOutboundStream outbound,
        IConfiguration configuration)
    {
        _node              = node;
        _snapshot          = snapshot;
        _registry          = registry;
        _outbound          = outbound;
        _configuration     = configuration;
        _nodeSynchronizers = new List <INodeSynchronizer>();
        _checkHealth       = new CheckHealth(_node.Id);
        _cancellable       = ScheduleHealthCheck();

        StartNode();
    }
Beispiel #3
0
    public void ChangeInputValue()
    {
        Transform   cheHealthbox    = this.transform.parent.parent;
        CheckHealth cheHealthScript = cheHealthbox.GetComponent <CheckHealth>();

        if (this.name == "InputName")
        {
            cheHealthScript.nameForHealth = this.GetComponent <InputField>().text;
        }
        else if (this.name == "InputHealth")
        {
            cheHealthScript.health = int.Parse(this.GetComponent <InputField>().text);
        }
        else if (this.name == "InputSign")
        {
            cheHealthScript.sign = this.GetComponent <InputField>().text;
        }
    }
 public HealthTest()
 {
     check = new CheckHealth();
 }
Beispiel #5
0
 public CanSeeEnemy(Character _character) : base(_character)
 {
     nodeTrue  = new DangerClose(_character);
     nodeFalse = new CheckHealth(_character);
     ai        = _character as AIController;
 }
Beispiel #6
0
        public void EnemyControllerUpdate(float deltaTime)
        {
            if (alive)
            {
                if (conditions.HasActiveConditions)
                {
                    CheckHealth.Invoke();
                    conditions.ConditionsUpdateStart(CharacterModel, ref spec, deltaTime);
                }

                ///<summary>
                ///Проверка состояния деятельности врага
                /// </summary>
                if (inChase)
                {
                    enemyView.enabled = false;
                    Chasing.Chase(player, deltaTime);
                    //Debug.Log("Chasing");
                }
                else if (comingHome)
                {
                    //Debug.Log("ComingHome");
                    timer += deltaTime;
                    ComingHome.ComingHome();
                    if (timer > 3f && !enemyView.enabled)
                    {
                        enemyView.enabled = true;
                    }
                }
                else if (onPatrol)
                {
                    Patroling.Patrol(route);
                }
                else if (onIdle)
                {
                    Idle.Idle();
                }
                else if (inFight)
                {
                    Fight.Fight(player, deltaTime);
                }
                else
                {
                    var choseAct = Random.Range(-patrolChance, idleChance);
                    if (choseAct < 0)
                    {
                        onPatrol = true;
                        route    = RouteGenerator.Compile(homePoint, spec.PatrolDistance);
                        patrolChance--;
                        idleChance = 5;
                    }
                    else
                    {
                        onIdle = true;
                        idleChance--;
                        patrolChance = 5;
                    }
                }
            }
            else
            {
                Move.Stop();
                headMesh.enabled    = false;
                gun.enabled         = false;
                knife.enabled       = false;
                enemyBorder.enabled = false;                          //выключаем коллайдер
                rb.constraints      = RigidbodyConstraints.FreezeAll; //замораживаем перемещения и повороты
                Dying.Die(mesh, deltaTime);                           //запускаем событие смерти
            }
        }