void Awake() { spawner = GameObject.FindWithTag("Spawner").GetComponent <Spawner>(); updateScore = GameObject.FindWithTag("UI").GetComponent <UpdateScore>(); trans = GetComponent <Transform>(); soundManager = GameObject.FindWithTag("GameManager").GetComponent <SoundManager>(); }
private void Start() { scoreUpdater = scoreCounterObject.GetComponent <UpdateScore>(); gameOverScreen = gameOverScreenObject.GetComponent <GameOverScreen>(); gController = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <GameplayController>(); playerSoundSrc = GetComponent <AudioSource>(); spriteRenderer = GetComponent <SpriteRenderer>(); bScroller = GameObject.FindGameObjectWithTag(Tags.GameController).GetComponent <BlockScroller>(); //Find out which joysticks we have connected, if any string[] controllers = Input.GetJoystickNames(); foreach (string controller in controllers) { Debug.Log(controller); if (controller.Contains("Xbox")) { UsingXBoneController = true; } if (controller.Contains("PLAYSTATION")) { Debug.Log("Detected PS3 Controller"); UsingPS3Controller = true; } } }
void Awake() { panelController = GetComponent <PanelController>(); cameraMove = GameObject.FindWithTag("MainCamera").GetComponent <CameraMove>(); updateScore = GameObject.FindWithTag("UI").GetComponent <UpdateScore>(); soundManager = GameObject.FindWithTag("GameManager").GetComponent <SoundManager>();; }
// Use this for initialization void Awake() { trans = GetComponent <Transform>(); panelController = GameObject.FindWithTag("UI").GetComponent <PanelController>(); updateScore = GameObject.FindWithTag("UI").GetComponent <UpdateScore>(); soundManager = GameObject.FindWithTag("GameManager").GetComponent <SoundManager>(); }
public string SetScore(int cycleId, int checkpoint, UpdateScore newScore) { //Do you need to explicitly overwrite //is it the same score? //was it okay? var cycle = GetScoreForCycle(cycleId); var reason = cycle.IsUpdatable(newScore, checkpoint, CheckPoint.Current()); if (!string.IsNullOrEmpty(reason)) { return(reason); } if (!cycle.SetScore(checkpoint, newScore, _scoreUpdater)) { return("SetScore Failed. Probably someone else updated it already."); } if (!cycle.HasMissingCPs()) { PostToSlack(cycle); return("post to slack"); } return("OK"); }
void Start() { score = GameObject.Find("Scores").GetComponent <Text>(); score.text = PlayerListLL.printAll(); PlayerListLL.Start(); UpdateScore.ResetScore(); }
// Use this for initialization void Start() { GameObject Score = GameObject.FindWithTag("Score"); if (Score != null) { score = Score.GetComponent<UpdateScore>(); } }
// Start is called before the first frame update void Start() { if (pType == PowerupType.ADD_TO_SCORE) { scoreObject = GameObject.FindGameObjectWithTag(Tags.HighScoreObject); scoreCounter = scoreObject.GetComponent <UpdateScore>(); } }
internal async Task SendScoreboardInfo(ScoreboardObjectivePacket packet, UpdateScore scorePacket = null) { await this.client.QueuePacketAsync(packet); if (scorePacket != null) { await this.client.QueuePacketAsync(scorePacket); } }
// Use this for initialization void Awake() { playerRigid = GetComponent <Rigidbody>(); playerTrans = GetComponent <Transform>(); spawner = GameObject.FindWithTag("Spawner").GetComponent <Spawner>(); cameraMove = GameObject.FindWithTag("MainCamera").GetComponent <CameraMove>(); panelController = GameObject.FindWithTag("UI").GetComponent <PanelController>(); updateScore = GameObject.FindWithTag("UI").GetComponent <UpdateScore>(); soundManager = GameObject.FindWithTag("GameManager").GetComponent <SoundManager>(); }
public static void SaveScore(UpdateScore curScore) { BinaryFormatter bf = new BinaryFormatter(); FileStream stream = new FileStream(Application.persistentDataPath + "/score.swag", FileMode.Create); ScoreData scoreData = new ScoreData(curScore); bf.Serialize(stream, scoreData); stream.Close(); }
private void HandleUpdateScore(UpdateScore x) { Label lbl = (Label)Program.myForm.Controls.Find(key: $"Lbl{x.Avatar}", searchAllChildren: false).FirstOrDefault(); lbl.Text = $"{x.Avatar}:{x.Score}"; var c = (PictureBox)Program.myForm.Controls.Find(key: x.CoinName, searchAllChildren: false).FirstOrDefault(); Program.myForm.Controls.Remove(c); }
IEnumerator GameTimer() { while (!Dead) { yield return(new WaitForSeconds(1)); secondsAlive += 1; UpdateScore.Invoke(secondsAlive); } }
/* * Start * * Grab ship rigidbody, create the desired particle type (specified * in Unity editor) and begin displaying particles to ship. */ void Start() { // Grab spaceship from attached game object. spaceship = GetComponent <Rigidbody>(); // Create ship thruster particles. thrusters = ParticleFactory.Get(ParticleType.Direction); //adding to the ship score and health (cosette) myHealth = GetComponent <UpdateHealth>(); myScore = GetComponent <UpdateScore>(); }
private void Start() { BackGround.color = new Color32(255, 255, 255, 136); Score.text = UpdateScore.GetScore().ToString(); GameOverTitle.fontSize = 75; GameOverTitle.text = "GAME OVER"; GameOverTitle.font = Font1; GameOverTitle.color = Color.black; InputField.sprite = input; ConfirmButton.sprite = confirmButton; Confirm.font = Font2; }
void Awake() { //Get a reference to ShowPanels attached to UI object showPanels = GetComponent <ShowPanels> (); //Get a reference to PlayMusic attached to UI object playMusic = GetComponent <PlayMusic> (); textColor = GetComponent <TextColor>(); updateScore = GetComponent <UpdateScore>(); }
void OnTriggerEnter(Collider collider) { if (score == null) { score = GameObject.Find("GameController").GetComponent <UpdateScore>(); } if (collider.gameObject.tag == "Player") { gameObject.SetActive(false); score.incrementScore(); } }
/// <summary> /// Initializes the dictionary object. /// </summary> /// <returns>Commands dictionary.</returns> private static Dictionary <string, IGameCommand> InitializeList() { Dictionary <string, IGameCommand> list = new Dictionary <string, IGameCommand>(); IGameCommand loginCommand = new Login(); list.Add(loginCommand.Name, loginCommand); IGameCommand getPlayerCommand = new GetPlayersList(); list.Add(getPlayerCommand.Name, getPlayerCommand); IGameCommand selectPlayerCommand = new SelectPlayer(); list.Add(selectPlayerCommand.Name, selectPlayerCommand); IGameCommand uiLoadCompleteCommand = new UILoadComplete(); list.Add(uiLoadCompleteCommand.Name, uiLoadCompleteCommand); IGameCommand updateScoreCommand = new UpdateScore(); list.Add(updateScoreCommand.Name, updateScoreCommand); IGameCommand gameCompleteCommand = new GameComplete(); list.Add(gameCompleteCommand.Name, gameCompleteCommand); IGameCommand sendJigSawCoordinates = new SendJigSawCoordinates(); list.Add(sendJigSawCoordinates.Name, sendJigSawCoordinates); IGameCommand selectTile = new SelectTile(); list.Add(selectTile.Name, selectTile); IGameCommand disableTile = new DisableTile(); list.Add(disableTile.Name, disableTile); IGameCommand assignTile = new AssignTile(); list.Add(assignTile.Name, assignTile); IGameCommand resetTile = new ResetTile(); list.Add(resetTile.Name, resetTile); return(list); }
void Start() { if (_updateScore != null) { GameObject.Destroy(_updateScore); } else { _updateScore = this; } DontDestroyOnLoad(this); gameScore = 0; }
public async Task <object> Put(UpdateScore request) { var response = new BaseResponse(); Expression <Func <Score, bool> > keySelector = x => x.StudentId == request.StudentId && x.SubjectId == request.SubjectId; var entity = await _scoreService.GetById(keySelector : keySelector); request.ToEntity(entity); var result = await _scoreService.Update(entity); response.Success = true; response.Message = "Update score success"; response.StatusCode = (int)HttpStatusCode.OK; response.Results = result.ConvertTo <ScoreDto>(); return(response); }
IEnumerator ArrowTriggerRight(Vector3 startPos, GameObject target, float time) { float i = 0.0f; float rate = 1.0f / time; while (i < 1.0) { Vector3 endPos = target.transform.position; //endPos.y += 1.0f; i += Time.deltaTime * rate; curArrowRight.transform.position = Vector3.Lerp(startPos, endPos, i); yield return(null); } Destroy(curArrowRight); if (SliderMovementRight.curState == SliderMovementRight.State.Sweet || (SliderMovementRight.curState == SliderMovementRight.State.Meh && yellowRight)) { SoundManager.instance.PlaySingle(arrowImpact); if (target.gameObject.name.Contains("Civilian")) { target.GetComponent <ChangeSpriteOnInput>().ChangeSprite(3); SoundManager.instance.PlaySingle(arrowImpactCiv); UpdateScore.ScoreUpdate(2, -3); } else { target.GetComponent <ChangeSpriteOnInput>().ChangeSprite(2); SoundManager.instance.PlaySingle(arrowImpact); UpdateScore.ScoreUpdate(2, 1); } } else { SoundManager.instance.RightArrowRandom(arrowMiss); } while (SliderMovementRight.isFiring) { yield return(null); } // Reset final flavor text if activated SliderMovementRight.Instance.flavorText[3].enabled = false; isFiredRight = false; animRight.SetBool("shoot", false); }
void Update() { timer += Time.deltaTime; if (timer >= 1) { score++; UpdateScore.Invoke(score); timer = 0; } //if(this.score % 50 == 0) //{ // this.speed++; // for (int i = 0; i < obstaclesSpawner.obj.Length; i++) // { // obstaclesSpawner.obj[i].GetComponent<Obstacles>().speed = this.speed; // } //} }
public void ChangeSprite(int type) { ParticleSystem[] ps = GetComponentsInChildren <ParticleSystem>(); switch (type) { case 1: if (ps[2].isPlaying) { ps[2].Stop(); ps[4].Play(); ps[5].Play(); UpdateScore.ScoreUpdate(1, 1); UpdateScore.ScoreUpdate(2, 1); SoundManager.instance.PlayCombo(arrowCombo); } else { ps[0].Play(); } break; case 2: if (ps[0].isPlaying) { ps[0].Stop(); ps[4].Play(); ps[5].Play(); UpdateScore.ScoreUpdate(2, 1); UpdateScore.ScoreUpdate(1, 1); SoundManager.instance.PlayCombo(arrowCombo); } else { ps[2].Play(); } break; case 3: ps[0].Play(); break; } }
/// <summary> /// Initializes the dictionary object. /// </summary> /// <returns>Commands dictionary.</returns> private static Dictionary <string, IGameCommand> InitializeList() { Dictionary <string, IGameCommand> list = new Dictionary <string, IGameCommand>(); IGameCommand loginCommand = new Login(); list.Add(loginCommand.Name, loginCommand); IGameCommand getBuddyPlayersCommand = new GetBuddyPlayers(); list.Add(getBuddyPlayersCommand.Name, getBuddyPlayersCommand); IGameCommand selectBuddyCommand = new SelectBuddy(); list.Add(selectBuddyCommand.Name, selectBuddyCommand); IGameCommand uiLoadCompleteCommand = new UILoadComplete(); list.Add(uiLoadCompleteCommand.Name, uiLoadCompleteCommand); IGameCommand sendDotPointCommand = new SendDotPoint(); list.Add(sendDotPointCommand.Name, sendDotPointCommand); IGameCommand sendMousePointCommand = new SendMousePoint(); list.Add(sendMousePointCommand.Name, sendMousePointCommand); IGameCommand updateScoreCommand = new UpdateScore(); list.Add(updateScoreCommand.Name, updateScoreCommand); IGameCommand gameCompleteCommand = new GameComplete(); list.Add(gameCompleteCommand.Name, gameCompleteCommand); return(list); }
private void OnMatchBlock() { int matchCount = selectedBlockSet.CoordList.Count; int multiplier = GetMultiplier(); //match count multiplier //combo multiplier //item multiplier CurrentScore += (matchCount * perBlockScore) * multiplier; UpdateScore?.Invoke(CurrentScore); #region Local Functions int GetMultiplier() { if (matchCount >= 10) { return(10); } if (matchCount >= 8) { return(5); } if (matchCount >= 6) { return(2); } return(1); } #endregion }
void Start() { StartCoroutine(RandomLevel()); StartCoroutine(addToScore()); score = GetComponent <UpdateScore>(); }
protected virtual void OnUpdateScore() => UpdateScore?.Invoke();
//initialization void Awake() { UpdateScore = GameObject.FindObjectOfType <UpdateScore>(); }
// Start is called before the first frame update void Start() { gList = bSpawner.GetBlockList(); scoreCounter = ScoreCounterObject.GetComponent <UpdateScore>(); //scrollingObjects = GameObject.FindGameObjectsWithTag(Tags.NonProcedurals); }
public void AddValue(int count) { _count += count; UpdateScore?.Invoke(_count); }
private void OnCollisionEnter(Collision collision) { UpdateScore.PassScoreToDataRedCube(); Destroy(gameObject); }