Example #1
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;
    }