Exemple #1
0
    private void OnTriggerEnter(Collider other)
    {
        Pickable obj = other.gameObject.GetComponent <Pickable>();

        if (obj && obj.canPick() && !ready) //if pickable
        {
            Debug.Log("Sticking: " + Time.time);
            holder.ToggleHoldable(other.gameObject, true);
            holder.pickUp(transform.position);
            ready = true;
        }
    }