예제 #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>();
 }