private float enemyScale; // Sets the default scale of the enemy to make sure that all enemies are the same size. void Start() { UpdateDistFromPlayer(); // Grab initial player distance reference. player = GameObject.Find("Player").GetComponent <PlayerFighting>(); // Target player health/damage object. score = GameObject.Find("ScoreUI").GetComponent <CountScore>(); // Target the gameobject handled within the CountScore script. animator = gameObject.GetComponent <Animator>(); // Get reference of the enemy animator. playerLocation = GameObject.Find("Player").transform; // Set initial values of enemy variants: if (gameObject.name == "Boss") { health = 1000f; enemyScale = 0.1f; // Make the boss scale larger than regular enemies. damage = 20f; // Boss deals higher damage than regular enemies. } else if (gameObject.name == "Miniboss") // Set miniboss to intermediate stage of damage, health etc. (between regular enemy and boss). { health = 250f; enemyScale = 0.09f; } else { health = 100f; enemyScale = 0.07f; } }
void Start() { animator = GetComponentInChildren <Animator>(); countScore = GameObject.Find("Score").GetComponent <CountScore>();//抓取 Score 的 Component Target = GameObject.FindGameObjectWithTag("Player"); }
// Use this for initialization void Start() { _score = 0; SetScoreText(); InvokeRepeating("AddPoints", 1.0f, 1.0f); if (Instance) { throw new Exception("Multiple CountScore instances"); } Instance = this; }
void Start() { meshAgent = GetComponent <NavMeshAgent>(); animator = GetComponentInChildren <Animator>(); countScore = GameObject.Find("Score").GetComponent <CountScore>();//抓取 Score 的 Component // Target = GameObject.FindGameObjectWithTag("Player"); meshAgent.speed = Random.Range(2, 5); // AI的 range area meshAgent.acceleration = Random.Range(6, 10); //產生出生特效 Instantiate(RefBorn, transform.position, transform.rotation); }
void Dying() { StartCoroutine(ScreenFader.FadeOut()); animator.SetBool("isDrowning", false); animator.SetTrigger("Die"); Camera.main.GetComponent <CameraMovement>().target = null; GetComponent <CircleCollider2D>().enabled = false; isDead = true; rb.velocity = new Vector2(0f, dieFallSpeed); Camera.main.GetComponent <CameraMovement>().PlayBubblesSound(); FinishCanvasThing.SetActive(true); //GameObject.FindGameObjectWithTag("ScoreScreen").SetActive(true); StartCoroutine(CountScore.Activate(CollectableSystem.instance.score)); }
// Use this for initialization void Start() { countScore = GetComponent<CountScore>(); isGenerated = false; }
void Start() { cs = FindObjectOfType <CountScore>(); pm = FindObjectOfType <PlayerMovement>(); }
void Start() { countScore = gameController.GetComponent<CountScore>(); }
private void Awake() { countScore = GameObject.Find("Score").GetComponent <CountScore>(); }
// Start is called before the first frame update void Start() { NewScore = GameObject.FindWithTag("ScoreManager").GetComponent <CountScore>(); }