Beispiel #1
0
    private void Awake()
    {
        anim       = GetComponentInChildren <Animator>();
        colliders  = GetComponentsInChildren <Collider>();
        pathing    = GetComponent <EnemyPathing>();
        randomizer = GetComponent <MaterialRandomizerBase>();

        scrapPrefab = Instantiate(scrapPrefab, MobileUiManager.um_single.scrapCanvas.transform);
        scrap       = scrapPrefab.GetComponent <MobileUiScrap>();
        scrap.Init(Movement.m_Single.topdownCamera.transform);

        if (CheckForSpawner())
        {
            GameObject health = Instantiate(spawner.GetMobileUiHealtPrefab(), transform.position, Quaternion.identity);
            mobileUiHealth = health.GetComponent <MobileUiHealth>();
            mobileUiHealth.SetTarget(this);
            mobileUiHealth.transform.SetParent(MobileUiManager.um_single.mobileUiCanvas.transform);
            mobileUiHealth.gameObject.SetActive(false);
        }
        gameObject.SetActive(false);
    }