internal void SupportDestroyed(PulleySupport pulleySupport) { if (m_support != pulleySupport) { Jotunn.Logger.LogWarning("Invalid callback from " + pulleySupport.GetZDOID() + " to " + this.GetZDOID() + ", expected " + m_support.GetZDOID()); return; } m_support = null; }
internal void SetSupport(PulleySupport pulleySupport) { #if DEBUG Jotunn.Logger.LogWarning(GetInstanceID() + ": Setting support for pulley @ " + this.transform.position + " " + gameObject.GetInstanceID() + ": " + pulleySupport.GetInstanceID()); #endif m_support = pulleySupport; if (!m_baseRoot) { GameObject baseSyncObject = Object.Instantiate(PrefabManager.Instance.GetPrefab(PulleyManager.MoveableBaseSyncName), transform.position, transform.rotation); MoveableBaseSync moveableBaseSync = baseSyncObject.GetComponent <MoveableBaseSync>(); moveableBaseSync.AddNewPiece(GetComponent <Piece>()); } }