private void Start() { initialized = true; transform.localPosition = CalculateCenterPosition(box); last_position = transform.localPosition; floatingObj = GameObject.Find("FloatingProducts").GetComponent <FloatingProducts>(); if (floatingObj == null) { Debug.LogError("Couldnt't find floating products object !"); } }
public void ReAttach(ShelfGenerator sg = null) { FloatingProducts fp = transform.GetComponentInParent <FloatingProducts>(); if (fp != null) { this.deattached = false; fp.ReAttach(sg); } else { Debug.LogError("Attempting to re-attach without beeing in floating products"); } }