Esempio n. 1
0
 void Start()
 {
     shipLights = GameObject.FindObjectOfType<ShipLights>();
     envManager = GameObject.FindObjectOfType<EnvironmentManager>();
     subRes = GameObject.FindObjectOfType<Submarine_Resources>();
        //     envMan = GameObject.FindObjectOfType<ActiveEnvironments>();
     if (!shipCol)
     {
         shipCol = myShip.GetComponent<Collider>();
     }
 }
Esempio n. 2
0
 private void UpdateManagers()
 {
     cityManager = this.gameObject.GetComponent<CityManager>();
     environmentManager = this.gameObject.GetComponent<EnvironmentManager>();
     financeManager = this.gameObject.GetComponent<FinanceManager>();
     legislationManager = this.gameObject.GetComponent<LegislationManager>();
     popularityManager = this.gameObject.GetComponent<PopularityManager>();
     powerPlantManager = this.gameObject.GetComponent<PowerPlantManager>();
     researchDevelopmentManager = this.gameObject.GetComponent<ResearchDevelopmentManager>();
     resourceManager = this.gameObject.GetComponent<ResourceManager>();
     management = true;
     ++count;
 }
Esempio n. 3
0
File: RL.cs Progetto: eddaly/elvis
    void populateReferences()
    {
        GameObject foundObject;

        foundObject = GameObject.Find( "MainCamera" );
        if( foundObject != null )
            m_MainCamera = foundObject.GetComponent<Camera>();

        foundObject = GameObject.Find( "MainLoop" );
        if( foundObject != null )
            m_MainLoop = foundObject.GetComponent<MainLoop>();

        foundObject = GameObject.Find( "TitleScreen" );
        if( foundObject != null )
            m_EntryScreen = foundObject.GetComponent<EntryScreen>();

        foundObject = GameObject.Find( "Environment" );
        if( foundObject != null )
            m_Environment = foundObject.GetComponent<EnvironmentManager>();

        foundObject = GameObject.Find( "Obstacles" );
        if( foundObject != null )
            m_Obstacles = foundObject.GetComponent<ObstacleManager>();

        foundObject = GameObject.Find( "Sequencer" );
        if( foundObject != null )
            m_Sequencer = foundObject.GetComponent<SequenceManager>();

        foundObject = GameObject.Find( "Prototype" );
        if( foundObject != null )
            m_Prototype = foundObject.GetComponent<PrototypeConfiguration>();

        foundObject = GameObject.Find( "Player" );
        if( foundObject != null )
            m_Player = foundObject.GetComponent<Player>();

        foundObject = GameObject.FindWithTag( "SoundController" );
        if( foundObject != null )
        {
            m_SoundController = foundObject.GetComponent<EPSoundController>();
            m_MusicPlayer = foundObject.GetComponent<EPMusicPlayer>();
        }
    }
Esempio n. 4
0
 void Start()
 {
     manager = GameObject.FindGameObjectWithTag("GameController").GetComponent <EnvironmentManager>();
 }
Esempio n. 5
0
 public static void InitializeEnvironment()
 {
     env = EnvironmentManager.GetEnvironment(TestContext.Parameters["TLRGEnv"] ?? Properties.RunSettings.Default.Run_Environment);
 }
 private void Awake()
 {
     mInstance = this;
     UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
     base.name = "EnvironmentManager";
 }
Esempio n. 7
0
 private static float futurePathCostHeuristic(int indexX, int indexY, int targetIndexX, int targetIndexY)
 {
     return(EnvironmentManager.ManhattanDiagonalDistance(indexX, indexY, targetIndexX, targetIndexY));
 }
Esempio n. 8
0
    // Use this for initialization
    void Start()
    {
        targetLane = 0;
        s_instance = this;

        /*for (int i = 10; i <= STARTCOUNT; i++)
         * {
         *  float horX = Random.Range(-5, 6);
         *  horX = horX * 2;
         *  int scaleY = Random.Range(2, 5);
         *  obstacleList.Add((GameObject)Instantiate(obstacle1, new Vector3(horX, 1, i * 10), transform.rotation));
         *  obstacle1.transform.localScale = new Vector3(2, scaleY, 2);
         * }*/

        spawnRamp = 0;

        for (int i = 10; i < STARTCOUNT; i++)
        {
            float horX = Random.Range(-5, 6);

            horX = horX * 2;
            int scaleY = Random.Range(2, 5);
            if (i % 20 == 0)
            {
                GameObject temp = (GameObject)Instantiate(ramp, new Vector3(horX, 0.4f, i * 10), ramp.transform.rotation);
                rampList.Add(temp);
                lastRamp = temp;
            }
            else
            {
                obstacle1.transform.localScale = new Vector3(2, scaleY, 2);
                obstacleList.Add((GameObject)Instantiate(obstacle1, new Vector3(horX, 1, i * 10), transform.rotation));
            }
        }

        //Stars
        for (int i = 10; i < 500; i++)
        {
            float horX   = Random.Range(-40, 40);
            float height = Random.Range(25, 30);
            // star.transform.localScale = new Vector3(2, scaleY, 2);
            starList.Add((GameObject)Instantiate(star, new Vector3(horX, height, i), transform.rotation));
        }


        for (int i = 0; i <= 6; i++)
        {
            groundList.Add((GameObject)Instantiate(ground, new Vector3(0, .5f, i * ground.renderer.bounds.size.z), transform.rotation));
        }
        for (int i = 0; i <= 6; i++)
        {
            wallList.Add((GameObject)Instantiate(wall, new Vector3(-12f, 10, i * wall.renderer.bounds.size.z), wall.transform.rotation));
            wallList.Add((GameObject)Instantiate(wall, new Vector3(12f, 10, i * wall.renderer.bounds.size.z), wall.transform.rotation));
            wall.transform.localScale = new Vector3(20, 1, 50);
        }

        /*for (int i = 1; i <= 1000; i++)
         * {
         *  float horX = Random.Range(-10, 10);
         *  rampList.Add((GameObject)Instantiate(ramp, new Vector3(horX, 0, i * 200), ramp.transform.rotation));
         *              //ramp.transform.position = new Vector3(ramp.transform.position.x, ramp.transform.position.y - 1, ramp.transform.position.z);
         * }*/

        for (int i = 1; i <= 10; i++)
        {
            int   side = Random.Range(0, 2);
            float Xpos = 0;
            if (side == 0)
            {
                Xpos = -11.6f;
            }
            else
            {
                Xpos = 11.6f;
            }
            float horY = Random.Range(5, 10);

            float scaleX = Random.Range(2, 3);
            beam.transform.localScale = new Vector3(scaleX, 1, 1);
            crossBeam.Add((GameObject)Instantiate(beam, new Vector3(Xpos, horY, i * 50), beam.transform.rotation));
        }
    }
Esempio n. 9
0
 // Update is called once per frame
 void Update()
 {
     UpdateMetrics();
     timeText.text = $"{Numbers.OneDP(EnvironmentManager.GetInstance().timeOfDay/EnvironmentManager.DAY_IN_SECONDS)}";
 }
Esempio n. 10
0
        /// <summary>
        /// Loads the current config object with data retrieved from the Sports API
        /// </summary>
        public void Load()
        {
            ExecutionLog.LogInformation("Loading config info from Sports API");
            lock (_lock)
            {
                if (_apiConfigLoaded)
                {
                    throw new InvalidOperationException("The API configuration is already loaded");
                }

                if (Environment != SdkEnvironment.Replay)
                {
                    try
                    {
                        // first try get bookmaker details from wanted UF environment
                        LoadWhoamiData(_publicConfig.ApiHost, UseApiSsl, true, Environment);
                    }
                    catch (Exception ex)
                    {
                        ExecutionLog.LogError(ex, $"Failed to load whoami data. Environment={Enum.GetName(typeof(SdkEnvironment), Environment)}");

                        var wantedEnvironment = EnvironmentManager.GetSetting(Environment);
                        if (wantedEnvironment != null && !wantedEnvironment.EnvironmentRetryList.IsNullOrEmpty())
                        {
                            foreach (var sdkEnvironment in wantedEnvironment.EnvironmentRetryList)
                            {
                                var newSetting = EnvironmentManager.GetSetting(sdkEnvironment);
                                if (newSetting != null && !string.IsNullOrEmpty(newSetting.ApiHost))
                                {
                                    if (newSetting.OnlySsl && !UseApiSsl)
                                    {
                                        ExecutionLog.LogWarning("Configuration set to not use SSL when connecting to API.");
                                    }
                                    var result  = LoadWhoamiData(newSetting.ApiHost, UseApiSsl, false, sdkEnvironment);
                                    var message = $"Access denied. The provided access token is not valid for the {sdkEnvironment} environment.";
                                    if (result)
                                    {
                                        message = $"Access granted. The provided access token is valid for the {sdkEnvironment} environment.";
                                    }
                                    ExecutionLog.LogWarning(message);
                                }
                            }
                        }

                        throw;
                    }
                }
                else
                {
                    //replay server supports both integration & production tokens, so the token must be checked against both environments
                    if (!LoadWhoamiData(EnvironmentManager.GetApiHost(SdkEnvironment.Integration), UseApiSsl, false, SdkEnvironment.Integration))
                    {
                        try
                        {
                            LoadWhoamiData(EnvironmentManager.GetApiHost(SdkEnvironment.Production), UseApiSsl, true, SdkEnvironment.Production);
                        }
                        catch (Exception ex)
                        {
                            ExecutionLog.LogError(ex, $"Failed to load whoami data. Environment={Enum.GetName(typeof(SdkEnvironment), Environment)}");
                        }
                    }
                }
                _apiConfigLoaded = true;
            }
        }
        public override void ExecuteTask(EnvironmentManager environmentManager, KillProcessTask updateTask,
                                         Logger logger, StatusUpdater statusUpdater)
        {
            Process[] processes;
            switch (updateTask.SearchMode)
            {
            case ProcessSearchMode.ProcessName:
                processes = Process.GetProcessesByName(updateTask.SearchString);
                break;

            case ProcessSearchMode.ProcessNameContains:
                processes = Process.GetProcesses().Where(x =>
                                                         x.ProcessName.IndexOf(updateTask.SearchString, StringComparison.OrdinalIgnoreCase) > -1)
                            .ToArray();
                break;

            case ProcessSearchMode.Filename:
                var filename = environmentManager.TranslateFilename(updateTask.SearchString);
                processes = Process.GetProcesses().Where(x =>
                {
                    try
                    {
                        return(string.Equals(x.MainModule.FileName, filename, StringComparison.OrdinalIgnoreCase));
                    }
                    catch (Exception)     //invalid access exception or something else
                    {
                        return(false);
                    }
                }).ToArray();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            if (processes.Length == 0)
            {
                logger.Info("No processes found, finish task");
                return;
            }

            logger.Info($"{processes.Length} process(es) found");
            foreach (var process in processes)
            {
                statusUpdater.UpdateStatus(statusUpdater.Translation.KillProcess, process.ProcessName);

                var    closedMainWindow = false;
                string processFilename  = null;

                logger.Debug($"Get process filename of process {process.ProcessName}");
                try
                {
                    processFilename = process.MainModule.FileName;
                }
                catch (Exception e)
                {
                    logger.Warning($"Getting process filename failed: {e.Message}");
                }

                logger.Debug("Attempt to close main window");
                try
                {
                    closedMainWindow = process.CloseMainWindow();
                }
                catch (Exception e)
                {
                    logger.Warning($"Closing main window failed: {e.Message}");
                }

                logger.Debug($"Closing main window result: {closedMainWindow}");
                try
                {
                    if (!closedMainWindow || !process.WaitForExit(3000))
                    {
                        logger.Info("Kill process");
                        process.Kill();
                    }
                }
                catch (Exception e)
                {
                    logger.Warning($"Killing process failed: {e.Message}");

                    if (updateTask.IsImportantForUpdateProcess)
                    {
                        throw;
                    }

                    continue;
                }

                if (processFilename != null)
                {
                    if (KilledProcesses == null)
                    {
                        KilledProcesses = new List <string>();
                    }
                    KilledProcesses.Add(processFilename);
                }
            }
        }
Esempio n. 12
0
 public MapOne()
 {
     Background  = new BackgroundManager(ContentManager.Background[0]);
     Environment = new EnvironmentManager();
 }
Esempio n. 13
0
    public override void OnInspectorGUI()
    {
        PlayerGraphicsSetting setting = serializedObject.targetObject as PlayerGraphicsSetting;

        EditorGUILayout.Space();
        EditorGUILayout.Space();


        EditorGUILayout.LabelField("---------------------------");
        EditorGUILayout.LabelField("材质Lod目前只有龙有变化");
        EditorGUILayout.LabelField("500为有描边,400以下无描边");
        EditorGUILayout.LabelField("角色bloom,角色颜色校正需要启用角色分层");
        EditorGUILayout.LabelField("特效bloom,特效颜色校正需要启用特效分层");
        EditorGUILayout.LabelField("角色分层需要HDR的支持");
        EditorGUILayout.LabelField("SSR和AO需要MRT支持");

        EditorGUILayout.LabelField("---------------------------");

        SerializedProperty field = serializedObject.FindProperty("frameRate");

        EditorGUILayout.PropertyField(field, new GUIContent("锁定上限帧率"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("shaderLod");
        EditorGUILayout.PropertyField(field, new GUIContent("材质Lod(默认500,400)"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("resolutionLevel");
        EditorGUILayout.PropertyField(field, new GUIContent("分辨率级别"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("displayFPS");
        EditorGUILayout.PropertyField(field, new GUIContent("显示帧率"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("dynamicQuality");
        EditorGUILayout.PropertyField(field, new GUIContent("动态画质"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("hdr");
        EditorGUILayout.PropertyField(field, new GUIContent("HDR"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("shadow");
        EditorGUILayout.PropertyField(field, new GUIContent("阴影"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("playerLayer");
        EditorGUILayout.PropertyField(field, new GUIContent("角色分层"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("alphaBuffer");
        EditorGUILayout.PropertyField(field, new GUIContent("透明分层"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("distortion");
        EditorGUILayout.PropertyField(field, new GUIContent("空气扭曲"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("sceneBloom");
        EditorGUILayout.PropertyField(field, new GUIContent("场景bloom"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("alphaBloom");
        EditorGUILayout.PropertyField(field, new GUIContent("特效bloom"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("playerBloom");
        EditorGUILayout.PropertyField(field, new GUIContent("角色bloom"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("sceneColorLookup");
        EditorGUILayout.PropertyField(field, new GUIContent("场景颜色校正"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("alphaColorLookup");
        EditorGUILayout.PropertyField(field, new GUIContent("特效颜色校正"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("playerColorLookup");
        EditorGUILayout.PropertyField(field, new GUIContent("角色颜色校正"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("mask");
        EditorGUILayout.PropertyField(field, new GUIContent("遮罩"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("antialiasing");
        EditorGUILayout.PropertyField(field, new GUIContent("抗锯齿"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("depthOfField");
        EditorGUILayout.PropertyField(field, new GUIContent("景深"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("ambientOcclusion");
        EditorGUILayout.PropertyField(field, new GUIContent("环境光遮蔽"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("lumaOcclusion");
        EditorGUILayout.PropertyField(field, new GUIContent("明度遮蔽"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("heightFog");
        EditorGUILayout.PropertyField(field, new GUIContent("高度雾"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("volumetricFog");
        EditorGUILayout.PropertyField(field, new GUIContent("体积雾"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("vignette");
        EditorGUILayout.PropertyField(field, new GUIContent("晕映"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("border");
        EditorGUILayout.PropertyField(field, new GUIContent("边缘效果"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("radialBlur");
        EditorGUILayout.PropertyField(field, new GUIContent("径向模糊"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("cloudShadow");
        EditorGUILayout.PropertyField(field, new GUIContent("云投影"));

        EditorGUILayout.Space();
        field = serializedObject.FindProperty("stochasticSSR");
        EditorGUILayout.PropertyField(field, new GUIContent("屏幕空间反射"));


        EditorGUILayout.Space();
        field = serializedObject.FindProperty("chromaticAberration");
        EditorGUILayout.PropertyField(field, new GUIContent("色彩偏移"));


        if (Application.isPlaying)
        {
            EnvironmentManager envManager = GameObject.FindObjectOfType <EnvironmentManager>();
            if (envManager)
            {
                envManager.EnvironmentObjectToUnity(envManager.curEnv);
            }
        }

        serializedObject.ApplyModifiedProperties();
    }
Esempio n. 14
0
 // Start is called before the first frame update
 void Start()
 {
     tm = FindObjectOfType <TelemetryManager>();
     em = GetComponent <EnvironmentManager>();
     this.SetupWatcher();
 }
Esempio n. 15
0
 void Awake()
 {
     manager = GameObject.FindGameObjectWithTag("GameManagers").GetComponent <BuildingAssetsManager>();
     env     = GameObject.FindGameObjectWithTag("GameManagers").GetComponent <EnvironmentManager>();
 }
Esempio n. 16
0
 public void WithMissingXmlFileTest()
 {
     var builder = EnvironmentManager.Create(x => x.WithXmlFile("xmlxxxxxxxx.xml"));
     var parser  = builder.Configuration.GetValue <XmlFileParser>(typeof(XmlFileParser).FullName);
     //does not throw
 }
Esempio n. 17
0
 public static void SetUp()
 {
     EnvironmentManager.Clear();
 }
Esempio n. 18
0
    public override void Execute()
    {
        base.Execute();

        EnvironmentManager.GetInstance().SetSkyColor(skyColor_);
    }
Esempio n. 19
0
 void Start()
 {
     e_manager      = FindObjectOfType <EnvironmentManager>();
     audioSourceTmp = Camera.main.GetComponent <AudioSource>();
 }