Example #1
0
    private void OnTriggerEnter(Collider other)
    {
        var obj = other.GetComponentInParent <MoveableObject>();

        if (obj && obj.benneable && !other.isTrigger)
        {
            fx.transform.position = obj.transform.position;
            fx.Play();
            audiosource.PlayOneShot(clip);

            if (obj.benneOmozons)
            {
                var plate = other.GetComponentInParent <Plate>();
                if (plate != null)
                {
                    plate.Clean();
                }
                delivery.ScheduleDelivery(obj.gameObject);
                obj.gameObject.SetActive(false);
            }
            else
            {
                Destroy(obj.gameObject);
            }
        }
    }
Example #2
0
    public virtual void Burn()
    {
        amazon.ScheduleDelivery(gameObject);
        gameObject.SetActive(false);
        var obj = Instantiate(amazon.burningMessPrefab, transform.position, Quaternion.identity);

        obj.GetComponent <Rigidbody>().AddForce(Vector3.up * 5, ForceMode.Impulse);
    }
Example #3
0
    private void OnTriggerEnter(Collider other)
    {
        var obj = other.GetComponentInParent <MoveableObject>();

        if (obj && obj.benneOmozons)
        {
            delivery.ScheduleDelivery(obj.gameObject);
            obj.gameObject.SetActive(false);
        }
    }