Exemple #1
0
 void Start()
 {
     if (SceneManager.GetActiveScene().buildIndex == 1)
     {
         SetUpMoveBoundaries();
         health = (int)(basehealth - (OptionController.GetDifficulty() * 166));
     }
 }
Exemple #2
0
    private void Die()
    {
        float deathVolume = Mathf.Clamp(OptionController.GetMasterVolume(), 0f, deathSoundVolume);

        FindObjectOfType <Level>().LoadGameOver();
        Destroy(gameObject);
        AudioSource.PlayClipAtPoint(deathSound, Camera.main.transform.position, deathVolume);
    }
    private void Setup()
    {
        uiController.SetActive(true);

        //  Set up our options
        Options = new OptionController(new Options(), UIController.Instance.GetOptionUIScript());
        Task t = Options.Setup();
    }
Exemple #4
0
    private void Fire()
    {
        float      shootVolume = Mathf.Clamp(OptionController.GetMasterVolume(), 0f, shootSoundVolume);
        GameObject laser       = Instantiate(projectile, transform.position, Quaternion.identity) as GameObject;

        laser.GetComponent <Rigidbody2D>().velocity = new Vector2(0, -projectileSpeed);
        AudioSource.PlayClipAtPoint(shootSound, Camera.main.transform.position, shootVolume);
    }
    public OptionController Instance()
    {
        if (instance == null)
        {
            instance = this;
        }

        return(instance);
    }
Exemple #6
0
    private void Die()
    {
        float deathVolume = Mathf.Clamp(OptionController.GetMasterVolume(), 0f, deathSoundVolume);

        FindObjectOfType <GameSession>().AddToScore(scoreValue);
        Destroy(gameObject);
        GameObject explosion = Instantiate(deathVFX, transform.position, Quaternion.identity);

        Destroy(explosion, durationOfExplosion);
        AudioSource.PlayClipAtPoint(deathSound, Camera.main.transform.position, deathVolume);
    }
Exemple #7
0
 static APIContext()
 {
     Assemblies   = new AssemblyController();
     Options      = new OptionController();
     Components   = new ComponentController();
     CPUs         = new ReadOnlyBaseComponentController <ComponentCPU>("cpu");
     RAMs         = new ReadOnlyBaseComponentController <ComponentRAM>("ram");
     GPUs         = new ReadOnlyBaseComponentController <ComponentGPU>("gpu");
     HDDs         = new ReadOnlyBaseComponentController <ComponentHDD>("hdd");
     SSDs         = new ReadOnlyBaseComponentController <ComponentSSD>("ssd");
     PowerUnits   = new ReadOnlyBaseComponentController <ComponentPowerUnit>("powerunit");
     Motherboards = new ReadOnlyBaseComponentController <ComponentMotherboard>("motherboard");
 }
Exemple #8
0
        public void Initialize()
        {
            StreamWriter writer = new StreamWriter("../../../contestTests/Repository/testFile.txt");

            writer.WriteLine("");
            writer.Close();

            repoCandidate  = new CandidateRepository(new CandidateValidator());
            repoDepartment = new DepartmentRepository(new DepartmentValidator());
            repoOption     = new OptionFileRepository(new OptionValidator(), "../../../contestTests/Repository/testFile.txt",
                                                      repoDepartment, repoCandidate);
            controller = new OptionController(repoOption);
        }
 void Awake()
 {
     if (inctence == null)
     {
         inctence    = this;
         animator    = gameObject.GetComponent <Animator>();
         canvasGroup = gameObject.GetComponentInChildren <CanvasGroup>();
         sfx         = gameObject.GetComponent <AudioSource>();
     }
     else if (inctence != this)
     {
         Destroy(this.gameObject);
     }
 }
 //
 void Awake()
 {
     // Makes the current instance a static one.
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     //
     DontDestroyOnLoad(gameObject);
 }
Exemple #11
0
    public void setDefaultOptions()
    {
        print("MainMenu: setDefaultOptions()");
        int defaultOption = PlayerPrefs.GetInt(FIRST_TIMER_KEY);

        if (defaultOption <= 0)
        {
            OptionController.setDefaultOptions();
            PlayerPrefs.SetInt(FIRST_TIMER_KEY, 1);
        }
        else
        {
            print("MainMenu: setDefaultOptions(): Not first timer");
        }
    }
Exemple #12
0
        /*
         * Constructor
         */
        public OptionView(OptionController optionController, CandidateController candidateController,
                          DepartmentController departmentController)
        {
            InitializeComponent();

            this.optionController     = optionController;
            this.departmentController = departmentController;
            this.candidateController  = candidateController;

            comboBoxCandidate.DropDownStyle  = ComboBoxStyle.DropDownList;
            comboBoxDepartment.DropDownStyle = ComboBoxStyle.DropDownList;

            optionController.addObserver(this);
            candidateController.addObserver(this);
            departmentController.addObserver(this);
            update();
        }
Exemple #13
0
    IEnumerator FireContinuously()
    {
        float shootVolume = Mathf.Clamp(OptionController.GetMasterVolume(), 0f, shootSoundVolume);

        while (true)
        {
            if (canTripleShot == true)
            {
                GameObject laser = Instantiate(tripleShotPrefab, transform.position, Quaternion.identity) as GameObject;
                laser.GetComponent <Rigidbody2D>().velocity = new Vector2(0, projectileSpeed);
            }

            else if (canTripleShot == false)
            {
                GameObject laser = Instantiate(laserPrefab, transform.position, Quaternion.identity) as GameObject;
                laser.GetComponent <Rigidbody2D>().velocity = new Vector2(0, projectileSpeed);
            }

            AudioSource.PlayClipAtPoint(shootSound, Camera.main.transform.position, shootVolume);
            yield return(new WaitForSeconds(projectileFiringPeriod));
        }
    }
        static void Main()
        {
            CandidateValidator      validatorCandidate  = new CandidateValidator();
            CandidateFileRepository repositoryCandidate = new CandidateFileRepository(validatorCandidate, "../../Data/Candidates.txt");
            CandidateController     controllerCandidate = new CandidateController(repositoryCandidate);

            DepartmentValidator      validatorDepartment  = new DepartmentValidator();
            DepartmentFileRepository repositoryDepartment = new DepartmentFileRepository(validatorDepartment, "../../Data/Departments.txt");
            DepartmentController     controllerDepartment = new DepartmentController(repositoryDepartment);

            OptionValidator      validatorOption  = new OptionValidator();
            OptionFileRepository repositoryOption = new OptionFileRepository(validatorOption, "../../Data/Options.txt",
                                                                             repositoryDepartment, repositoryCandidate);
            OptionController controllerOption = new OptionController(repositoryOption);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new HomePage(
                                new CandidateView(controllerCandidate),
                                new DepartmentView(controllerDepartment),
                                new OptionView(controllerOption, controllerCandidate, controllerDepartment)));
        }
Exemple #15
0
 public void PlayMusic(string clipName, float initialVolume)
 {
     // Find the clip to play
     foreach (SoundClip musicClip in music)
     {
         if (musicClip.clipName == clipName)
         {
             AudioSource audioSource = gameObject.GetComponent <AudioSource>();
             audioSource.clip   = musicClip.clip;
             audioSource.volume = initialVolume;
             audioSource.pitch  = musicClip.pitch;
             audioSource.Play();
             currentSoundtrack = musicClip.clipName;
             // Debug.Log("===> Playing: " + clipName + " (" + musicClip.clip.length + ")");
             // Update the track name in options menu
             OptionController optionMenu = FindObjectOfType <OptionController>();
             if (optionMenu != null)
             {
                 optionMenu.UpdateTrackName(currentSoundtrack);
             }
         }
     }
 }
Exemple #16
0
 // Use this for initialization
 void Start()
 {
     optController   = GameObject.FindObjectOfType <OptionController> ();
     fadePanel       = GetComponent <Image> ();
     fadePanel.color = currentColor;
 }
Exemple #17
0
 public void Cleanup()
 {
     repoCandidate = null; repoDepartment = null; repoOption = null; controller = null;
 }
Exemple #18
0
 // Start is called before the first frame update
 void Awake()
 {
     options = new OptionController(new Options(), script);
     options.Setup();
 }
Exemple #19
0
 public void Open()
 {
     // Canvasを表示する
     OptionController.SetActive("Option_Canvas", true);
 }
Exemple #20
0
        //Проблема с паролями.
        static void Main(string[] args)
        {
            Console.Title = "Первая игра";
            UserController.Authorization();
            string name = UserController.CurentUserName;

            Console.Clear();
            User CurentUser = UserController.ReturnCurentUser(name);

            Console.WriteLine("Авторизация прошла успешно!");
            Console.WriteLine($"Вы вошли под логином {CurentUser.Login}");
            Console.WriteLine("Для продолжения нажмите любую клавишу...");
            Console.ReadKey();
            Console.Clear();
            while (true)
            {
                const string PlayButton       = "Играть.";
                const string StatisticsButton = "Статистика.";
                const string OptionButton     = "Настройки.";
                const string ExitButton       = "Выход.";
                Element[,] elements = new Element[, ]
                {
                    {
                        new Element(PlayButton)
                    },
                    {
                        new Element(StatisticsButton)
                    },
                    {
                        new Element(OptionButton)
                    },
                    {
                        new Element(ExitButton)
                    }
                };
                ChoseMenu MainMenu = new ChoseMenu(elements);
                MainMenu.MenuButtonSet();
                switch (MainMenu.ChosenElement.Text)
                {
                case PlayButton:
                    PlayInterface A = new PlayInterface();
                    A.CreateBorder();
                    A.PositionSet(50, 50);
                    GameController.KeyAssignment(A);
                    break;

                case StatisticsButton:
                    StaticsController.StaticList();
                    break;

                case OptionButton:
                    OptionController.OptionMenu();
                    break;

                case ExitButton:
                    Thread.CurrentThread.Abort();
                    Thread.Sleep(1000);
                    break;
                }
                Console.Clear();
            }
        }
 // Start is called before the first frame update
 void Awake()
 {
     audioSource        = GetComponent <AudioSource>();
     audioSource.volume = OptionController.GetMasterVolume();
     SetUpSingleton();
 }
 private void Awake()
 {
     gameController   = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
     optionController = gameController.OptionController;
 }