// Use this for initialization void Start() { scoreKeep = GameObject.Find("ScoreKeeper").GetComponent <ScoreKeep> (); popupText += "\n\n (Click to close)"; GameObject.Find("Popup").transform.GetChild(0).GetComponent <Text> ().text = popupText; isTouch = false; }
// Use this for initialization void Start() { scoreKeep = GameObject.Find ("ScoreKeeper").GetComponent<ScoreKeep> (); popupText += "\n\n (Click to close)"; GameObject.Find ("Popup").transform.GetChild (0).GetComponent<Text> ().text = popupText; isTouch = false; }
// Use this for initialization void Start() { displayResult = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ScoreKeep>(); logScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <log>(); logScript.file.Close(); }
void OnTriggerEnter(Collider otherCollider) { if (otherCollider == expectedCollider) { ScoreKeep scorekeep = FindObjectOfType <ScoreKeep> (); scorekeep.IncrementScore(1); } }
// Start is called before the first frame update void Start() { Target = Waypoints.waypoints[waypointIndex]; Life = 0; HP = 100; Speed = MaxSpeed; ScoreKeeper = FindObjectOfType <ScoreKeep>(); }
public void ToNextLevel() { int currentSceneIndex = SceneManager.GetActiveScene().buildIndex; ScoreKeep sk = FindObjectOfType <ScoreKeep>(); sk.SetMoney(300); sk.lastLvl = currentSceneIndex + 1; Instantiate(Restarter); }
void Start() { if (FindObjectOfType <ScoreKeep>() != null) { ScoreKeep sk = FindObjectOfType <ScoreKeep>(); ScoreAtLevel = sk.GetScore(); MoneyAtLevel = sk.GetMoney(); HpAtLevel = sk.GetPlayerHP(); } }
void OnTriggerEnter(Collider otherCollider) { if (otherCollider == expectedCollider) { ScoreKeep scoreKeep = FindObjectOfType <ScoreKeep>(); LevelManager lvlManager = FindObjectOfType <LevelManager>(); scoreKeep.IncrementScore(1); lvlManager.IncrementTime(); } }
// Use this for initialization void Start() { ScoreKeep oldKeep = FindObjectOfType <ScoreKeep>(); if (oldKeep) { score = oldKeep.score; Destroy(oldKeep.gameObject); } }
public void RestartLevel() { int currentSceneIndex = SceneManager.GetActiveScene().buildIndex; ScoreKeep sk = FindObjectOfType <ScoreKeep>(); sk.SetPlayerHP(HpAtLevel); sk.SetScore(ScoreAtLevel); sk.SetMoney(MoneyAtLevel); sk.lastLvl = currentSceneIndex; Instantiate(Restarter); }
public void ToTitleScreen() { SceneManager.LoadScene(0); if (FindObjectsOfType <ScoreKeep>().Length > 0) { GameCanvas gc = FindObjectOfType <GameCanvas>(); ScoreKeep sk = FindObjectOfType <ScoreKeep>(); Destroy(gc.gameObject); Destroy(sk.gameObject); } }
IEnumerator CheckForCollision() { yield return(null); if (collided) { ScoreKeep sk = FindObjectOfType <ScoreKeep>(); sk.SpendMoney(-300); Debug.Log("Can not place here"); Destroy(this.gameObject); } }
// Use this for initialization void Start() { rend = GetComponent <Renderer>(); grabScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GrabDropScript>(); coinCounter = 0; logScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <log>(); source = GetComponent <AudioSource>(); pec = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PecCard>(); scoreKeep = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ScoreKeep>(); scoreVector = new Vector3(0, 25, 0); scoreKeepBody = GameObject.Find("BodyPlaceHolders").GetComponent <ScoreKeep>(); gameManager = GameManager.getInstance(); }
// Start is called before the first frame update void Awake() { DontDestroyOnLoad(this.gameObject); gc = FindObjectOfType <GameCanvas>(); sk = FindObjectOfType <ScoreKeep>(); Money = sk.GetMoney(); Score = sk.GetScore(); playerHP = sk.GetPlayerHP(); loadMe = sk.lastLvl; Destroy(gc.gameObject); Destroy(sk.gameObject); gc = null; sk = null; SceneManager.LoadScene(loadMe); }
void Start() { //pec = new GameObject[arraySize]; //Associate the variables with Components in the MainCamera grabScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <GrabDropScript>(); interactionManager = GameObject.FindGameObjectWithTag("MainCamera").GetComponents <InteractionManager>(); result = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Timer>(); scriptLog = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <log>(); engagementMeter = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <EngagementMeter>(); faceTrackingManager = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <FacetrackingManager>(); scoreKeepBody = GameObject.Find("BodyPlaceHolders").GetComponent <ScoreKeep>(); source = GetComponent <AudioSource>(); //Gets AudioSource from the attached Object }
private void Update() { if (FindObjectsOfType <ScoreKeep>().Length > 0) { sk = FindObjectOfType <ScoreKeep>(); sk.SetMoney(Money); sk.SetScore(Score); sk.SetPlayerHP(playerHP); Destroy(this.gameObject); } if (FindObjectsOfType <FinalCanvas>().Length > 0) { FinalCanvas fc = FindObjectOfType <FinalCanvas>(); fc.Score.GetComponent <TextMeshProUGUI>().text = "" + Score; Destroy(this.gameObject); } }
// Update is called once per frame void Update() { if (!player && end) { gameOverScreen.SetActive(true); int currentScore = ScoreKeep.GetScore(); if (currentHighScore < currentScore) { SetNewHighScore(currentScore); } string highestScore = currentHighScore.ToString(); DisplayHighScore(highestScore); end = false; } }
void OnCollisionEnter(Collision collision) { ScoreKeep scorekeep = FindObjectOfType <ScoreKeep> (); scorekeep.IncrementScore(scorePerHit); }
// Start is called before the first frame update void Start() { gameCanvas = FindObjectOfType <GameCanvas>().gameObject; ScoreKeeper = FindObjectOfType <ScoreKeep>(); }
// Start is called before the first frame update void Start() { ScoreKeep temp = FindObjectOfType <ScoreKeep>(); ScoreKeeper = temp.gameObject; }
// Use this for initialization void Start() { score = FindObjectOfType <ScoreKeep>(); text = GetComponent <Text>(); }