Пример #1
0
    void Awake()
    {
        // retrieve all states
        basicState = GetComponent <SpiderTankBasicState>();
        fleeState  = GetComponent <SpiderTankFleeState>();
        healState  = GetComponent <SpiderTankHealState>();
        laserSpin  = GetComponent <SpiderTankLaserSpin>();
        rushState  = GetComponent <SpiderTankRushState>();
        turboState = GetComponent <SpiderTankTurboState>();
        enterState = GetComponent <SpiderTankEnterState>();

        // retrieve other componenets
        health       = GetComponent <HealthSystem>();
        spawner      = GetComponent <EnemySpawner>();
        agent        = GetComponent <NavMeshAgent>();
        boxCollider  = GetComponent <BoxCollider>();
        ringUICanvas = GetComponentInChildren <Canvas>();
        meshes       = GetComponentsInChildren <MeshRenderer>();
        animator     = GetComponentInChildren <Animator>();

        // register for player death callback
        player.gameObject.GetComponent <DeathSystem>().RegisterDeathCallback(PlayerDeathCallback);

        // register for damage callbacks
        health.RegisterHealthCallback(SpiderDamageCallback);
        healthCheckpoints.currentPhase = 0;

        // set hand player over as the target to a bunch of script
        KeepDistance keepDistance = GetComponent <KeepDistance>();

        if (keepDistance != null)
        {
            keepDistance.target = player;
        }
        mortarLauncher.mortarSettings.targets    = new Transform[1];
        mortarLauncher.mortarSettings.targets[0] = player;
        spawnerLauncher.spiderTank = this;

        spawner.settings = phaseSettings[0].spawnerSettings;

        _healthMaxStart = health.maxHealth;
        _healthMaxCurr  = _healthMaxStart;
    }
Пример #2
0
        public override string ToString()
        {
            string str = "";

            str += Signals.ToString() + ",";
            str += LookingAtMirrors.ToString() + ",";
            str += Parking.ToString() + ",";
            str += ParkingInReverse.ToString() + ",";
            str += KeepDistance.ToString() + ",";
            str += Speed.ToString() + ",";
            str += Bypassing.ToString() + ",";
            str += DriveInTheRightLane.ToString() + ",";
            str += PreemptiveRight.ToString() + ",";
            str += Stopping.ToString() + ",";
            str += ObedienceToTrafficSigns.ToString() + ",";
            str += AddressingPedestrians.ToString() + ",";
            str += ALeapInTheRise.ToString() + ",";
            str += ChangeGears.ToString() + ",";
            str += EngineShutdown.ToString() + ",";
            str += IntegrationIntoMovement.ToString() + ",";
            str += SkillForVehicleOperation.ToString() + ",";
            str += AeactionTime.ToString() + ",";
            return(str);
        }