//private AudioSource audioSource; //public AudioClip overSound; //public AudioClip killSound; //public AudioClip clearSound; private void Start() { textGameOver.enabled = false; textClear.enabled = false; nextSceneButton.SetActive(false); score = 0; leftTime = 30f; //audioSource = gameObject.AddComponent<AudioSource>(); //textScore = GameObject.Find("Score").GetComponent<Text>(); //textLife = GameObject.Find("BallLife").GetComponent<Text>(); textTimer = GameObject.Find("TimeText").GetComponent <Text>(); //textResultScore = GameObject.Find("Result Score").GetComponent<Text>(); textResultHP = GameObject.Find("Result HP").GetComponent <Text>(); textResultTime = GameObject.Find("Result Time").GetComponent <Text>(); textResultTotal = GameObject.Find("Result Total").GetComponent <Text>(); textHighScore = GameObject.Find("HighScore").GetComponent <Text>(); SetScoreText(score); SetHighScoreText(highScore); inGame = true; playerhp = playerPrefab.GetComponent <PlayerHPBar>(); player = playerPrefab.GetComponent <Player>(); }
// Use this for initialization void Start() { enemiesInRange = Physics2D.OverlapCircleAll(transform.position, 5); if (currentWeapon == null) { foreach (Transform child in transform) { if (child.gameObject.CompareTag("item")) { currentWeapon = child; } } //currentWeapon = } ac = ammoCounter.GetComponent <AmmoCounter>(); ac.newWeapon(currentWeapon.GetComponent <Weapon>()); hpb = hpbar.GetComponent <PlayerHPBar>(); hpb.max = health; hpb.current = hpb.max; hpb.setHP(health); }
private void Awake() { instance = this; }
public Transform fallout; //falloutを格納 // Use this for initialization void Start() { playerhp = playerPrefab.GetComponent <PlayerHPBar>(); }