void OnTriggerExit(Collider other)
    {
        if (!other.CompareTag("Worker"))
        {
            return;
        }
        //Debug.Log ("Trigger exit WORKER");

        BazarController tmp = transform.parent.GetComponent <BazarController>();

        foreach (GameObject iMerchant in tmp.m_merchantList)
        {
            MerchantSellHandler m = iMerchant.GetComponent <MerchantSellHandler>();
            m.ForgetTarget(other);
        }
    }
Esempio n. 2
0
    void createMerchants()
    {
        for (int i = m_merchantList.Count; i < m_numberOfMerchants; i++)
        {
            GameObject obj = (GameObject)Instantiate(m_merchantPrefab);
            obj.transform.parent = transform;
            obj.name             = "Merchant " + i.ToString();
            //obj.transform.localScale -= new Vector3(0.25f,0.25f,0);

            //obj.transform.Translate(p,Space.World);
            Vector3 startLocation = new Vector3(transform.position.x + i / 2.0f, transform.position.y, transform.position.z - 30f);
            //z: -1,5
            obj.transform.Translate(startLocation, Space.World);

            m_merchantList.Add(obj);
            MerchantSellHandler m = obj.GetComponent <MerchantSellHandler>();
            m.SetBazaar(this);
        }
    }