Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     StartCoroutine(MainScript());
     transform.position    = new Vector3(transform.position.x * gameManager.cam.aspect, transform.position.y, transform.position.z);
     healthAtLastInterrupt = life;
 }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     superAttackGraphic = transform.FindChild("FireLine").gameObject;
     superAttackGraphic.SetActive(false);
     gameManager = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     animator    = GetComponent <Animator2D>().Child("Plane");
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     speed                 = new Vector3(-3, 0, 3);
     gameManager           = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     spawnAudioSource      = GetComponent <AudioSource>();
     spawnAudioSource.clip = gameManager.soundManager.OwlBossShot;
     spawnAudioSource.Play();
 }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     if (reposition)
     {
         transform.position = new Vector3(transform.position.x * gameManager.cam.aspect, transform.position.y, transform.position.z);
     }
 }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     rotationPhase = Random.Range(0f, 1f);
     Instantiate(explosion, transform.position, /*Quaternion.Euler(0, Random.Range(0,360f),0)*/ Quaternion.identity);
     gameManager           = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     deathAudioSource      = GetComponent <AudioSource>();
     deathAudioSource.clip = gameManager.soundManager.OwlDeath;
     deathAudioSource.Play();
 }
Esempio n. 6
0
 // Use this for initialization
 void Start()
 {
     speed       = new Vector3(0, 0, -0.3f);
     gameManager = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     direction   = Vector3.back;
     if (homing)
     {
         direction = -(transform.position - gameManager.GetDragon().transform.position).normalized;
     }
 }
Esempio n. 7
0
    void Awake()
    {
        instance = this;
        Physics.autoSimulation = false;

        analytics = new AircraftAnalytics(airplane, airplane.transform);

        ArgumentParser argParser = new ArgumentParser();

        argParser.AddArgument("-targetFrameRate", false, "50");
        argParser.AddArgument("-portAgentSend", false, "26001");
        argParser.AddArgument("-portAgentReceive", false, "26000");
        argParser.AddArgument("-trees", false, "1");
        argParser.AddArgument("-difficulty", false, "1.0");
        argParser.AddArgument("-actionFrequency", false, "1");
        argParser.AddArgument("-windAngle", false, "0");
        argParser.AddArgument("-windPower", false, "2.5");
        argParser.AddArgument("-windAngleDeviation", false, "25");
        argParser.AddArgument("-penaltyActionCoefficient", false, "0.000");
        argParser.AddArgument("-penaltyTimeCoefficient", false, "0.00000");
        argParser.AddArgument("-limitMode", false, "0");
        argParser.ParseArguments();

        difficulty                   = argParser.arguments["-difficulty"].valueFloat;
        limitMode                    = argParser.arguments["-limitMode"].valueInt;
        actionFrequency              = argParser.arguments["-actionFrequency"].valueInt;
        penaltyActionCoefficient     = argParser.arguments["-penaltyActionCoefficient"].valueFloat;
        penaltyTimeCoefficient       = argParser.arguments["-penaltyTimeCoefficient"].valueFloat;
        FlightWind.windPower         = argParser.arguments["-windPower"].valueFloat;
        FlightWind.windMean          = FlightWind.windPower;
        FlightWind.pitchDeviationMax = argParser.arguments["-windAngleDeviation"].valueFloat;
        FlightWind.yawDeviationMax   = argParser.arguments["-windAngleDeviation"].valueFloat;
        FlightWind.SetWindDirection(argParser.arguments["-windAngle"].valueFloat);
        Application.targetFrameRate = argParser.GetIntArgument("-targetFrameRate");
        QualitySettings.vSyncCount  = 0;

        externalAgent    = argParser.arguments["-portAgentSend"].isSupplied && argParser.arguments["-portAgentReceive"].isSupplied;
        portAgentSend    = argParser.arguments["-portAgentSend"].valueInt;
        portAgentReceive = argParser.arguments["-portAgentReceive"].valueInt;

        if (externalAgent)
        {
            agentController = new BoxExternalAgentController(observationDimension, actionDimension, portAgentSend, portAgentReceive);
        }
        else
        {
            agentController = new FlightHumanAgentController(flightInputReader);
        }

        if (argParser.arguments["-trees"].valueInt == 1)
        {
            treeGenerator.enabled = true;
        }
    }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
 }
Esempio n. 9
0
 // Use this for initialization
 void Start()
 {
     gameManager            = GameObject.Find("GameManager").GetComponent <FlightGameManager>();
     pickupAudioSource      = GetComponent <AudioSource>();
     pickupAudioSource.clip = gameManager.soundManager.Pickup;
 }
Esempio n. 10
0
 // Use this for initialization
 void Start()
 {
     gameManager = GameObject.Find("ManagerObject").GetComponent<FlightGameManager>();
     isActive = true;
 }