private void Awake() { rigidbody = GetComponent <Rigidbody2D>(); currentHealth = maxHealth; gfx = GetComponent <EnemyGFX>(); playerLayer = LayerMask.GetMask("Player"); }
private void Start() { Item[] temp_itemMoneys = FindObjectsOfType <Item>(); itemMoneys.AddRange(temp_itemMoneys); GFX_SCRIPT = GFX.GetComponent <EnemyGFX>(); speed = UnityEngine.Random.Range(speed - 200.0f, speed + 200.0f); }