Пример #1
0
 void Start()
 {
     m_gameManager     = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>();
     m_gameWin         = GameObject.FindGameObjectWithTag("UI").GetComponent <GameWin>();
     m_layerController = m_gameManager.GetComponent <LayerController>();
     m_launch          = GetComponent <AudioSource>();
 }
Пример #2
0
 void Start()
 {
     gameWin = GetComponent <GameWin>();
     ratingOutlineImage.gameObject.SetActive(false);
     ratingImage.gameObject.SetActive(false);
     reviewText.text       = "";
     scoreImage.fillAmount = 0;
 }
Пример #3
0
    private void OnEnable()
    {
        if (Instance != null && Instance != this)
        {
            GameObject.DestroyImmediate(gameObject);
            return;
        }

        Instance = this;
    }
Пример #4
0
 private void Awake()
 {
     if (instance != null && instance != this)
     {
         Destroy(transform.parent.gameObject);
     }
     else
     {
         instance = this;
     }
     instance.gameObject.SetActive(false);
 }
Пример #5
0
 void WinGame()
 {
     if (score > 1)
     {
         PlayerPrefs.SetInt("levelReached", SceneManager.GetActiveScene().buildIndex);
         GameWin.SetActive(true);
         publicDeactivates();
         gameWin = true;
         AlienCar.SetActive(false);
         AlienBullet.SetActive(false);
         AlienCar2.SetActive(false);
     }
 }
Пример #6
0
    private void Update()
    {
        if (RunnerGameState.IsGameRunning)
        {
            _distanceToFinish -= Time.deltaTime;

            if (_distanceToFinish <= 0.0f)
            {
                RunnerGameState.IsGameRunning = false;
                isWin = true;
                GameWin?.Invoke();
            }

            _distanceText.text = ((int)_distanceToFinish).ToString() + "m";
        }
    }
Пример #7
0
        public List <GameWin> GameWin(GameWin data)
        {
            string         connStr = "data source=werewolfkill.database.windows.net;initial catalog=Werewolfkill;persist security info=True;user id=Werewolfkill;password=Wolfpeoplekill_2020;MultipleActiveResultSets=True;";
            List <GameWin> r       = null;

            using (SqlConnection conn = new SqlConnection(connStr))
            {
                conn.Open();
                var paramater = new Models.GameWin {
                    Name = data.Name
                };
                var sql = " UPDATE  AspNetUsers SET Win = ISNULL(Win,0)+1 where UserName = @Name " +
                          "select UserName as Name,Win from AspNetUsers where UserName = @Name ";
                r = conn.Query <GameWin>(sql, paramater).ToList();
            }
            return(r);
        }
Пример #8
0
    private void NewMap()
    {
        // Chance to increase difficulty
        if (difficultyLevel <= 0)
        {
            difficultyLevel++;
        }
        else if (Level % 8 == 0)     // UnityEngine.Random.Range(1, 20) == 1
        {
            difficultyLevel++;
            MessageLog_Manager.NewMessage("Monsters become stronger...", Color.red);
            if (difficultyLevel > 10)
            {
                // Game win
                Debug.Log("You won the game!");
                Global.GameWin gameWin = new GameWin();
                gameWin.FireEvent();
                return;
            }
        }

        // TODO: PICK PROTOTYPE ACCORDING TO DIFFICULTY!
        if (difficultyLevel > 0)
        {
            List <LevelPrototype> potentialLevels = new List <LevelPrototype>();
            for (int i = 0; i < levelPrototypes.Length; i++)
            {
                if (levelPrototypes[i].difficultyLevel >= difficultyLevel - 1 &&
                    levelPrototypes[i].difficultyLevel <= difficultyLevel)
                {
                    potentialLevels.Add(levelPrototypes[i]);
                }
            }
            curLevelPrototype = potentialLevels[UnityEngine.Random.Range(0, potentialLevels.Count)];
        }


        if (curLevelPrototype.Name == string.Empty)
        {
            curLevelPrototype = levelPrototypes[1];
        }
        Debug.Log("New Map: diff=" + difficultyLevel + " curlvlProto name=" + curLevelPrototype.Name);

        mapManager.NewMap(Vector2.zero, Level, curLevelPrototype.darknessLevel);
    }
Пример #9
0
    private void HandleParty()
    {
        if (cage)
        {
            cage.transform.Rotate(new Vector3(0, 0, 180));
        }
        GameObject player = Player.GetInstance();

        player.transform.position = new Vector3(endSpot, player.transform.position.y, player.transform.position.z);
        GameManager.DestroyObject();
        GameWin.ShowGameWinScreen();

        for (int i = 0; i < friends.Length; i++)
        {
            friends[i].StartParty();
        }
        Player.GetInstanceControl().SetIsDancing(true);
    }
Пример #10
0
 public List <GameWin> GameWin(GameWin data)
 {
     return(_repo.GameWin(data));
 }
Пример #11
0
 private void Awake()
 {
     Singleton = this;
 }
 public List <GameWin> GameWin(GameWin data)
 {
     throw new NotImplementedException();
 }
Пример #13
0
 private void DrawGameWin(GameTime gameTime, GraphicsDeviceManager graphics, ContentManager content)
 {
     GameWin gameWin = new GameWin(this.spriteBatch, this.gameFont, content, graphics);
 }
Пример #14
0
 private void OnGameWin(GameWin data)
 {
     winPanel.SetActive(true);
 }
Пример #15
0
 public IActionResult GameWin(GameWin data)
 {
     return(Ok(_service.GameWin(data)));
 }
Пример #16
0
 void Awake()
 {
     gamewin = gameWin.GetComponent <GameWin>();
 }