Example #1
0
    private void Update()
    {
        if (IsActive)
        {
            AgentInformationController.CreateInfoIndicator("Name: " + gameObject.name + "\n" + "State: " + AgentStateMachine.currentState.ToString() + "\n Has Flag: " + HasFlag.ToString(), GameObjectPos);
            float Dist = Vector3.Distance(MousePos, Input.mousePosition);

            if (Dist > 2.0)
            {
                IsActive = false;
            }
        }
    }
Example #2
0
    void Start()
    {
        DrawRoute = false;
        DamageIndicatorController.Initialize();
        AgentInformationController.Initialize();
        Path = new PathInfo.PathRoute
        {
            PathList = new Vector3[200]
        };
        OpenList     = new List <Map.MapNode>(SetupScript.width * SetupScript.height);
        ClosedList   = new List <Map.MapNode>(SetupScript.width * SetupScript.height);
        rb           = GetComponent <Rigidbody>();
        Board        = new Blackboard();
        Mess         = GetComponent <Messager>();
        StateMachine = new StateMachine <AI>(this);

        MaxAmmo           = 20;
        Ammo              = MaxAmmo;
        MaxHealth         = 100;
        Health            = MaxHealth;
        MaxSpeed          = 4.0f;
        MaxBulletVelocity = 4.0f;
        MaxFireRate       = 0.5f;
        MaxDamage         = 25;

        Time          = 0;
        RespawnTimer  = 20;
        Respawn       = 20;
        GameTimer     = UnityEngine.Time.deltaTime;
        TimesDied     = 0;
        PlayersKilled = 0;

        NodeChangeDistance = 0.04f * MaxSpeed;

        HaveFlag   = false;
        AtSafeSpot = false;
        SeenEnemy  = false;
    }