internal void Update(Pulley pulley) { lineRenderer.enabled = pulley != null; if (lineRenderer.enabled) { lineRenderer.SetPositions(new Vector3[] { top.position, bottom.position }); } }
public void Awake() { m_nview = GetComponent <ZNetView>(); m_pulley = GetComponent <Pulley>(); #if DEBUG Jotunn.Logger.LogInfo(m_nview.m_zdo.m_uid + " Creating MoveableBaseRoot"); #endif m_baseControllerObject = Object.Instantiate(PrefabManager.Instance.GetPrefab(PulleyManager.MoveableBaseRootName), transform.position, transform.rotation); m_baseRoot = m_baseControllerObject.GetComponent <MoveableBaseRoot>(); m_baseRoot.SetBaseSync(this); }
public void SetPulley(Pulley pulley) { if (!pulley) { return; } m_pulley = pulley; AttachRopes(); pulley.SetSupport(this); m_nview.GetZDO().Set(PulleyBaseHash, pulley.GetZDOID()); }
internal void PulleyBaseDestroyed(Pulley pulley) { if (m_pulley != pulley) { Jotunn.Logger.LogWarning("Invalid callback from " + pulley.GetZDOID() + " to " + this.GetZDOID() + ", expected " + m_pulley?.GetZDOID()); return; } m_pulley = null; RemoveRopes(); InvokeRepeating("LookForSupport", PulleyUpdateTime, PulleyUpdateTime); }
public new void Awake() { m_nview = GetComponentInParent <ZNetView>(); m_nview.Register <ZDOID>("RequestControl", RPC_RequestControl); m_nview.Register <ZDOID>("ReleaseControl", RPC_ReleaseControl); m_nview.Register <bool>("RequestRespons", RPC_RequestRespons); m_pulley = GetComponentInParent <Pulley>(); m_baseRoot = GetComponentInParent <MoveableBaseRoot>(); m_ship = m_baseRoot; m_handAttach = m_pulley.transform.Find("New/crank/handattach").transform; m_attachPoint = m_pulley.transform.Find("attachpoint"); }