예제 #1
0
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Space))
     {
         EnvironmentControl.ShiftEnvironment();
     }
 }
예제 #2
0
 public EnvironmentForm(TrafficCollectionModel model, TrafficEnvironment environment) : this()
 {
     this.m_Model = model;
     this.m_IsNodeAdd = true;
     this.m_EnvControl = new EnvironmentControl(model, environment);
     this.GetPropertyAndSetForm();
 }
예제 #3
0
    void Awake()
    {
        Instance = this;
        Instance.activeEnvironment = 0;

        ParallaxControl[] sceneObjects = GameObject.Find("_World").GetComponentsInChildren <ParallaxControl>(true);

        foreach (ParallaxControl o in sceneObjects)
        {
            switch (o.gameObject.name)
            {
            case "Background":
                background = o.renderer;
                break;

            case "Ground":
                ground = o.renderer;
                break;

            case "Left":
                leftside = o.renderer;
                break;

            case "Right":
                rightside = o.renderer;
                break;
            }
        }

        cam             = GameObject.FindObjectOfType <CameraControl>();
        playerdive      = GameObject.FindObjectOfType <PlayerDiveInput>();
        playermove      = GameObject.FindObjectOfType <PlayerMovementControl>();
        playermoveinput = GameObject.FindObjectOfType <PlayerMovementInput>();
        sun             = GameObject.Find("_Sun").light;
    }
 void Start()
 {
     hoverObject   = GetComponent <Rigidbody>();
     originalColor = upFanBtn.image.color;
     activeColor   = new Color(231f / 255f, 76f / 255f, 60f / 255f, 255f / 255f);
     ChangeMassText();
     environmentControl = FindObjectOfType <EnvironmentControl>();
 }
예제 #5
0
    IEnumerator DoDeath()
    {
        p_dive.enabled  = false;
        p_input.enabled = false;
        p_movement.MovePlayer(new Vector3(0, -10, 0), 1f);

        yield return(new WaitForSeconds(.3f));

        CameraShake();

        yield return(new WaitForSeconds(.3f));

        CameraShake();

        yield return(new WaitForSeconds(.3f));

        CameraShake();

        yield return(new WaitForSeconds(1f));

        cam.FadeToColor(Color.black, 2f);

        yield return(new WaitForSeconds(2f));

        cam.SetText("but the warning never came...");
        cam.FadeTextIn();

        yield return(new WaitForSeconds(3f));

        cam.FadeToColor(Color.black, 2f);
        cam.FadeTextOut();

        yield return(new WaitForSeconds(2f));

        cam.FadeToColor(Color.black, 40f);
        cam.SetText("press [SPACE] to continue");
        cam.FadeTextIn();

        while (true)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                break;
            }
            yield return(null);
        }

        cam.FadeTextOut();

        EnvironmentControl.Reset();

        yield return(new WaitForSeconds(2f));

        StartCoroutine("StartGame");
    }
예제 #6
0
        public void Instance_ExpectedProperties()
        {
            // Call
            EnvironmentControl instance = EnvironmentControl.Instance;

            // Assert
            Assert.IsNotNull(instance);
            EnvironmentControl expectedInstance = EnvironmentControl.Instance;

            Assert.AreSame(expectedInstance, instance);
        }
예제 #7
0
 private EnvironmentControl GetEnvironmentControl(List <IWizardControl> controls)
 {
     foreach (var item in controls)
     {
         EnvironmentControl ctrl = item as EnvironmentControl;
         if (null != ctrl)
         {
             return(ctrl);
         }
     }
     throw new IndexOutOfRangeException("controls");
 }
예제 #8
0
        public void Instance_ValidEnvironmentControl_ExpectedProperties()
        {
            // Setup
            EnvironmentControl expectedInstance = EnvironmentControl.Instance;

            // Call
            EnvironmentControl.Instance = new EnvironmentControl();

            // Assert
            Assert.IsNotNull(expectedInstance);
            EnvironmentControl newInstance = EnvironmentControl.Instance;

            Assert.AreNotSame(expectedInstance, newInstance);
        }
예제 #9
0
 protected virtual void CreateEnvironmentControl(IEnvironment environment)
 {
     if (this.environmentControl != null)
     {
         this.environmentControl.Dispose();
     }
     this.environmentControl = new EnvironmentControl(environment, this.envPanel, this.cellSize, false, false);
     foreach (var cellControl in this.environmentControl.CellControls.Values)
     {
         cellControl.MouseClick       += this.CellControlMouseClick;
         cellControl.MouseDoubleClick += this.CellControlMouseDoubleClick;
         cellControl.Paint            += this.CellControlPaint;
     }
 }
예제 #10
0
    private void Update()
    {
        if (closestSucker)
        {
            RaycastHit hit;
            Vector3    startPoint = closestSucker.transform.position;
            startPoint.y -= 3f;
            if (Physics.Raycast(startPoint, (transform.position - startPoint).normalized, out hit))
            {
                if (!hit.collider.CompareTag("Player"))
                {
                    closestSucker = null;
                }
            }
        }

        foreach (EnvironmentControl sucker in suckerList)
        {
            float newDist = Vector3.Distance(sucker.transform.position, transform.position);
            if (newDist < closestDist)
            {
                closestDist   = newDist;
                closestSucker = sucker;
            }
        }
        suckerList  = new List <EnvironmentControl>();
        m_TickTime += Time.deltaTime;
        if (m_TickTime >= 1f)
        {
            Regen();
            m_TickTime = 0f;
        }

        if (outOfArea && !enteredSector)
        {
            canRegenHealth = false;
            canRegenOxygen = false;
            SetGravity(0);
            ReduceOxygen(0.5f);
        }
        else
        {
            enteredSector  = false;
            canRegenOxygen = playerOxygen < 100;
            canRegenHealth = playerOxygen >= 100 && playerHealth < 100;
            SetGravity(1);
        }
    }
예제 #11
0
    private void Awake()
    {
        instance = this;

        if (PlayerPrefs.HasKey("Finished Game"))
        {
            if (PlayerPrefs.GetInt("Finished Game") == 1)
            {
                GameFinished = true;
            }
            else
            {
                GameFinished = false;
            }
        }
        else
        {
            PlayerPrefs.SetInt("Finished Game", 0);
        }
    }
예제 #12
0
        private void LoadControls()
        {
            ProjectControl     control0 = new ProjectControl();
            EnvironmentControl control1 = new EnvironmentControl();
            HostControl        control2 = new HostControl();
            NameControl        control3 = new NameControl();
            LoadControl        control4 = new LoadControl();
            GuiControl         control5 = new GuiControl();

            _listControls.Add(control0);
            _listControls.Add(control1);
            _listControls.Add(control2);
            _listControls.Add(control3);
            _listControls.Add(control4);
            _listControls.Add(control5);

            panelControls.Controls.Add(control0);
            panelControls.Controls.Add(control1);
            panelControls.Controls.Add(control2);
            panelControls.Controls.Add(control3);
            panelControls.Controls.Add(control4);
            panelControls.Controls.Add(control5);

            control0.Dock = DockStyle.Fill;
            control1.Dock = DockStyle.Fill;
            control2.Dock = DockStyle.Fill;
            control3.Dock = DockStyle.Fill;
            control4.Dock = DockStyle.Fill;
            control4.Dock = DockStyle.Fill;

            SummaryControl control6 = new SummaryControl(_listControls);

            _listControls.Add(control6);
            panelControls.Controls.Add(control6);
            control6.Dock = DockStyle.Fill;

            _finishControl = new FinishControl();
            panelControls.Controls.Add(_finishControl);
            _finishControl.Dock = DockStyle.Fill;
            _finishControl.ReadyStateChanged += new ReadyStateChangedHandler(FinishControl_ReadyStateChanged);
        }
예제 #13
0
        public ProjectOptions(List <IWizardControl> controls)
        {
            ProjectControl projectControl = GetProjectControl(controls);

            ProjectType       = projectControl.SelectedProjectType(); // ToProjectType(projectControl.SelectedProjectType(1033), projectControl.UseTools);
            ProjectFolderType = projectControl.SelectedProjectFolderType();
            ProjectFolder     = projectControl.CalculatedFolder;

            EnvironmentControl envControl = GetEnvironmentControl(controls);

            Language            = ToLanguage(envControl.SelectedLanguage);
            IDE                 = ToIDE(envControl.SelectedIDE);
            NetRuntimeTarget    = ToRuntime(envControl.SelectedRuntime);
            UseNetRuntimeClient = ToRuntimeUseClient(envControl.SelectedRuntime);

            HostControl hostControl = GetHostControl(controls);

            SetOfficeApps(hostControl);

            NameControl nameControl = GetNameControl(controls);

            AssemblyName        = nameControl.AssemblyName;
            AssemblyDescription = nameControl.AssemblyDescription;

            LoadControl loadControl = GetLoadControl(controls);

            LoadBehaviour = Convert.ToInt32(loadControl.LoadBehaviour);

            List <string> list = new List <string>();

            foreach (var item in OfficeApps)
            {
                list.Add(String.Format("Software\\Microsoft\\Office\\{0}\\AddIns", item));
            }
            RegistryKeys = list.ToArray();

            HiveKey = loadControl.Hivekey;

            GuiControl guiControl = GetGuiControl(controls);

            UseClassicUI = guiControl.ClassicUIEnabled;
            UseRibbonUI  = guiControl.RibbonUIEnabled;
            UseTaskPane  = guiControl.TaskPaneEnabled;
            UseToogle    = guiControl.ToogleEnabled;

            if (NetRuntimeTarget == "4.0")
            {
                NetRuntime = UseNetRuntimeClient == true ? NetVersion.Net4Client : NetVersion.Net4;
            }
            else if (NetRuntimeTarget == "4.5")
            {
                NetRuntime = NetVersion.Net45;
            }
            else if (NetRuntimeTarget == "4.5.1")
            {
                NetRuntime = NetVersion.Net451;
            }
            else if (NetRuntimeTarget == "4.5.2")
            {
                NetRuntime = NetVersion.Net452;
            }
            else if (NetRuntimeTarget == "4.6")
            {
                NetRuntime = NetVersion.Net46;
            }
            else if (NetRuntimeTarget == "4.6.1")
            {
                NetRuntime = NetVersion.Net461;
            }
            else
            {
                throw new IndexOutOfRangeException("NetRuntimeTarget");
            }
        }
예제 #14
0
 public EnvironmentForm(TrafficCollectionModel model) : this()
 {
     this.m_Model = model;
     this.m_EnvControl = new EnvironmentControl(model);
     this.GetPropertyAndSetForm();
 }
예제 #15
0
    IEnumerator StartGame()
    {
        p_input.enabled = true;

        for (int i = 0; i < levels.Length; i++)
        {
            while (true)
            {
                p_input.enabled = true;
                for (int j = 0; j < levels[i].countHazards; j++)
                {
                    yield return(new WaitForSeconds(levels[i].delayBetween));

                    for (int k = -1; k < levels[i].groupHazards; k++)
                    {
                        SpawnRandomHazard(ref levels[i].availHazards);
                        yield return(new WaitForSeconds(.3f));
                    }
                }

                if (i == levels.Length - 1)
                {
                    Win();
                }

                yield return(new WaitForSeconds(4.5f));

                //Environment nighttime
                EnvironmentControl.Nighttime();

                if (i == 0)
                {
                    cam.SetText("hide from nocturnal pursuers\npress [SPACE] to dive\n\n\n\n");
                }
                if (i == 1)
                {
                    cam.SetText("press [SPACE] to surface\n\n\n");
                }
                if (i < 2)
                {
                    cam.FadeToColor(Color.clear, 10f);
                    cam.FadeTextIn();
                }
                p_dive.enabled = true;
                while (true)
                {
                    if (Input.GetKeyDown(KeyCode.Space))
                    {
                        break;
                    }
                    yield return(null);
                }
                cam.FadeTextOut();
                p_dive.enabled = false;

                yield return(new WaitForSeconds(3f));

                break;
            }
        }
    }
예제 #16
0
 private void Awake()
 {
     m_instance = this;
 }