Exemple #1
0
    // Start is called before the first frame update
    void Start()
    {
        if (!inventory)
        {
            inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <OAPlayerInventory>();
        }

        foreach (var child in children)
        {
            child.Master = this;
        }
    }
Exemple #2
0
    void Start()
    {
        if (!inventory)
        {
            inventory = GameObject.FindGameObjectWithTag("Player").GetComponent <OAPlayerInventory>();
        }

        spawnArea = GetComponent <BoxCollider2D>();

        spawner.OnEradicated.AddListener(OnHighTide);
        tide.OnHighTide.AddListener(OnHighTide);
        tide.OnLowTide.AddListener(DespawnAll);

        if (spawnOnStart)
        {
            OnHighTide();
        }
    }