Esempio n. 1
0
 public void OnTriggerExit(Collider other)
 {
     computer       = null;
     desk           = null;
     trashContainer = null;
     shelves        = null;
 }
Esempio n. 2
0
        public static void SwitchTrashWithIds(int itemId1, int itemId2)
        {
            TrashContainer container = GameMain.data.trashSystem.container;
            TrashObject    to        = container.trashObjPool[itemId1];
            TrashData      td        = container.trashDataPool[itemId1];

            container.trashObjPool[itemId1]  = container.trashObjPool[itemId2];
            container.trashDataPool[itemId1] = container.trashDataPool[itemId2];
            container.trashObjPool[itemId2]  = to;
            container.trashDataPool[itemId2] = td;
        }
Esempio n. 3
0
    private void OnTriggerEnter(Collider other)
    {
        GameObject go = other.gameObject;
        Trash      e  = go.GetComponent <Trash>();

        if (e != null)
        {
            // Update how many bottles have been collected, correctly or otherwise.
            e.type.incrementCollectedItems();
            if (e.type == type)
            {
                points.Variable.ApplyChange(type.PointValue);
                e.type.incrementCorrectCollectedItems();
            }
            TrashContainer trashContainer = GetComponentInParent <TrashContainer>();
            trashContainer.UpdateLabel(e.type);

            Destroy(e.gameObject);
            Collect.Raise();
        }
    }
Esempio n. 4
0
    public void OnTriggerStay(Collider other)
    {
        if (other.gameObject.CompareTag("Computer"))
        {
            computer = other.GetComponent <Computer>();
        }

        if (other.gameObject.CompareTag("Desk"))
        {
            desk = other.GetComponent <Desk>();
        }

        if (other.gameObject.CompareTag("TrashContainer"))
        {
            trashContainer = other.GetComponent <TrashContainer>();
        }

        if (other.gameObject.CompareTag("Shelves"))
        {
            shelves = other.GetComponent <Shelves>();
        }
    }