void Start() { m_ScoreManager = GetComponent<Score_Manager>(); IMG_GameOver = transform.Find("IMG_GameOver").gameObject; TXT_GameOver = transform.Find("IMG_GameOver").Find("TXT_GameOver").GetComponent<Text>(); TXT_YourScore = transform.Find("IMG_GameOver").Find("TXT_YourScore").GetComponent<Text>(); }
public IEnumerator RespawnPlayerCo() { // Generate Death Particle Instantiate(DeathParticle, PC.transform.position, PC.transform.rotation); // Hide Player // PC.enabled = false; PC2.SetActive(false); Gun.SetActive(false); Rocket.SetActive(false); PC.GetComponent <Renderer>().enabled = false; // Gravity Reset GravityStore = PC.GetComponent <Rigidbody2D>().gravityScale; PC.GetComponent <Rigidbody2D>().gravityScale = 0f; PC.GetComponent <Rigidbody2D>().velocity = Vector2.zero; // Point Penalty PointPenaltyOnDeath = 10; Score_Manager.AddPoints(-PointPenaltyOnDeath); // Debug Message Debug.Log("Player Respawn"); // Respawn Delay yield return(new WaitForSeconds(RespawnDelay)); // Gravity Restore PC.GetComponent <Rigidbody2D>().gravityScale = GravityStore; // Match Players transform position PC.transform.position = CurrentCheckpoint.transform.position; // Show Player // PC.enabled = true; PC2.SetActive(true); Gun.SetActive(true); Rocket.SetActive(true); PC.GetComponent <Renderer>().enabled = true; // Spawn Player Instantiate(RespawnParticle, CurrentCheckpoint.transform.position, CurrentCheckpoint.transform.rotation); }
// Use this for initialization void Start() { mainObj = GameObject.Find("balloon_main_obj"); _scoreManager = mainObj.GetComponent <Score_Manager>(); p_objFloat = transform.parent.gameObject.GetComponent <obj_float>(); }
void gameOver() { //stop keeping score and spawning new enemies count = false; Score_Manager.setActiveFalse(); EnemyManager.destroyAllEnemies(); Destroy(GameObject.FindGameObjectWithTag("Respawn")); }
// Use this for initialization void Start() { theScoreManager = FindObjectOfType <Score_Manager>(); // add isTrigger // BoxCollider boxCollider = GetComponent<BoxCollider>(); // boxCollider.isTrigger = true; }
// Use this for initialization void Start() { //風船の種類をランダムに4種類選択する GameObject[] Choice_Obj = (GameObject[])Resources.LoadAll <GameObject>("balloon"); for (int i = 0; i < 4;) { //読み込んだファイルの中のasset数からランダムに数字を入れる RandChoice_Balloon[i] = Random.Range(0, Choice_Obj.Length); //もし取り出した要素だったら処理をもう一度 if (Choice_Obj[RandChoice_Balloon[i]] == null) { continue; } //取り出した数字をNULLへ Choice_Obj[RandChoice_Balloon[i]] = null; i++; } //特殊風船の取得 for (int i = 0; i < 2;) { //プレイヤープレハブの中身がnullなら処理を通さない if (PlayerPrefs.GetString("SpecialBalloon_" + i) == "") { break; } //選択された特殊風船のcharを入れる m_spBalloonChar[i] = PlayerPrefs.GetString("SpecialBalloon_" + i); Debug.Log(m_spBalloonChar[i]); i++; } //最初の生成 StartCoroutine(ball_create(default_ball_count)); //commonと連携 //common.all_ball = default_ball_count; //スプライト変更のスクリプト _sprCount = canvas.GetComponent <Sprite_count>(); //スコアのgetとsetするために読み込み _scoreManager = GetComponent <Score_Manager>(); //pose画像初期表示 Pose_Canvas.GetComponent <Canvas>().enabled = false; //初期化 m_line.numPositions = 0; m_line.sortingLayerName = "Line"; m_line.enabled = true; //Ready? StartCoroutine(Ready_UI()); }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Enemy") { Instantiate(EnemyDeath, other.transform.position, other.transform.rotation); Destroy(other.gameObject); Instantiate(Coin, other.transform.position, other.transform.rotation); Score_Manager.AddPoints(PointsForKill); } }
// Use this for initialization void Start() { mainObj = GameObject.Find("balloon_main_obj"); _scoreManager = mainObj.GetComponent <Score_Manager>(); obj_trigger.GetComponent <CircleCollider2D>().enabled = false; p_objFloat = transform.parent.gameObject.GetComponent <obj_float>(); }
void OnTriggerEnter2D(Collider2D other) { if (other.GetComponent <Rigidbody2D>() == null) { return; } Score_Manager.AddPoints(pointsToAdd); Destroy(gameObject); }
// Use this for initialization void Start() { mainObj = GameObject.Find("balloon_main_obj"); _scoreManager = mainObj.GetComponent <Score_Manager>(); // Balloon_pr = GetComponent<Balloon_Parents>(); p_objFloat = transform.parent.gameObject.GetComponent <obj_float>(); GetComponent <CircleCollider2D>().enabled = false; GetComponent <CapsuleCollider2D>().enabled = false; }
private void Awake() { if (_Instance == null) { _Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
public void Swalling() { if (obj.activeSelf) { transform.localScale -= new Vector3(0.015F, 0.015F, 0); if (transform.localScale.x < 0.9 && transform.localScale.y < 0.9) { Score_Manager.GetPoint(obj); transform.localScale = new Vector3(3F, 3F, 0); obj.SetActive(false); } } }
void OnCollisionEnter(Collision col) { if (col.gameObject.GetComponent <Paintball>()) { audio.PlayOneShot(impact); //Check to make sure that it hasn't alreay been hit if (!hit) { //Preventing multiple hits hit = true; Score_Manager.updateScore(scoreValue); } } }
// Use this for initialization void Start() { theScoreManager = FindObjectOfType <Score_Manager>(); // add isTrigger // BoxCollider boxCollider = GetComponent<BoxCollider>(); // boxCollider.isTrigger = true; // } // Update is called once per frame // void Update() //{ }
/************************************************************************************************* *** Start *************************************************************************************************/ private void Start() { targetSelection = Random.Range(0, targets.Length); Debug.Log(targetSelection.ToString()); if (debugTarget) { targetSelection = debugTargetSelection; } currentTarget = GameObject.Find(targets[targetSelection]); transform.rotation = currentTarget.transform.rotation; score = FindObjectOfType <Score_Manager>(); healthManager = FindObjectOfType <Health_Manager>(); }
// Start is called before the first frame update void Start() { //Find and Set Score Manager // Pass to next Scene GameObject current_manager = GameObject.FindGameObjectWithTag("Score_Manager"); score_manager = current_manager.GetComponent <Score_Manager>(); //Find and set Score Display UI // Display to Player // Get all child doors foreach (Transform child in transform) { all_doors.Add(child.gameObject.GetComponent <Door_Spawn_Script>()); } //Reset Canvas values //Update_Score_Display(0); //Update_Death_Display(0); }
void Start() { score_manager = GameObject.Find("Game_Manager").GetComponent <Score_Manager>(); obstacle_Manager = GameObject.Find("Obstacle_Manager").GetComponent <Obstacle_Manager>(); }
// Use this for initialization void Start() { _balloonMainSc = GameObject.Find("balloon_main_obj").GetComponent <GameMain>(); m_score = GameObject.Find("balloon_main_obj").GetComponent <Score_Manager>(); this.gameObject.GetComponent <Rigidbody2D>().AddForce(new Vector2(0, 2f), ForceMode2D.Impulse); }
private void Awake() { instance = this; }
void Start() { theScoreManager = FindObjectOfType <Score_Manager>(); }
void Start() { game_manager = GameObject.Find("Game_Manager").GetComponent <Score_Manager>(); }
void Awake() { // get references main = this; myTransform = transform; myAnimator = GetComponent<Animator>(); myCamera = GameObject.Find("Gemini Camera").transform.Find("Camera").camera; myCameraTransform = GameObject.Find("Gemini Camera").transform; ScoreManager = GetComponent<Score_Manager>(); myHUD = myCameraTransform.GetComponent<HUD_Manager>(); myAlign = GetComponent<PlanetAlign>(); // settings joystickBitMask = 1<<LayerMask.NameToLayer("Joystick"); joystickCenter = myCamera.WorldToScreenPoint(GameObject.Find("Joystick").transform.position); // set up CreateCombos(); Texture[][] cosmicTextures = new Texture[3][]; cosmicTextures[0] = cosmicPower1; cosmicTextures[1] = cosmicPower2; cosmicTextures[2] = cosmicPower3; AttackMeter = new AttackMeter_Manager(this, cosmicButton, cosmicTextures, new int[] {50, 100, 150}, new string[] {"SpeedBoost", "KillAll", "HealthBoost"}); }