private void OnTriggerEnter(Collider other) { switch (other.gameObject.tag) { case "FactoryContainer": FactoryContainer fCon = other.gameObject.GetComponent <FactoryContainer>(); // Grab the third child in the Hierarchy and turn on the MeshRenderer other.gameObject.transform.GetChild(2).GetComponent <MeshRenderer>().enabled = true; other.gameObject.transform.GetChild(2).GetComponent <MeshCollider>().isTrigger = false; fCon.IsTopped = true; fCon.UpdateCheckList(); break; default: break; } }
void DropObjectInContainer(FactoryContainer targetContainer) { Debug.LogWarning("Factory Container Detected"); targetContainer.ActivatePlaceHolderFactoryObj(); targetContainer.IsFilled = true; targetContainer.UpdateCheckList(); // Send this Factory Object back to the Factory object "pool" this.Initialize(); // todo play sound? // Disable Interaction item m_interaction.enabled = false; m_rigid.useGravity = false; m_rigid.isKinematic = true; m_rigid.constraints = RigidbodyConstraints.None; //UpdateCheckList(); }