Exemple #1
0
    protected void Start()
    {
        succObject = Instantiate(succPrefab, transform);
        ItemCatcher itemCatcher  = succObject.GetComponentInChildren <ItemCatcher>();
        Collider2D  succCollider = itemCatcher.GetComponent <Collider2D>();

        itemCatcher.maxSize = succCollider.bounds.size.x * succCollider.bounds.size.y * maxSizeFactor;
    }
Exemple #2
0
    protected void Start()
    {
        inventory      = GetComponent <ItemInventory>();
        controls       = GetComponentInParent <Controls>();
        succCollider   = GetComponent <Collider2D>();
        playerCollider = controls.GetComponent <Collider2D>();
        ItemCatcher catcher = GetComponentInChildren <ItemCatcher>();

        catcherCollider = catcher.GetComponent <Collider2D>();
    }