private void InstantiateNewHose(DartChain beforeDartChain, DartChain afterDartChain) { var newHose = (DartChain)Instantiate(_dartChainPrefab, beforeDartChain.transform.position.Midpoint(afterDartChain.transform.position), transform.rotation); newHose.DartSource = DartSource; newHose.GunSource = GunSource; beforeDartChain.AddAfter(newHose); afterDartChain.AddBefore(newHose); Debug.Break(); }
public void AddAfter(DartChain dartChain, bool cascade = true) { //Check if we receive valid stuff if (AfterDartChain == null || (dartChain.GetInstanceID() != this.GetInstanceID() && dartChain.GetInstanceID() != AfterDartChain.GetInstanceID())) { //If cascading and there is a node to cascade if (cascade) { dartChain.AddBefore(this, false); } if (!MainRigidbody.isKinematic) { HingeJoint.connectedBody = dartChain.MainRigidbody; AfterDartChain = dartChain; } } else { Debug.LogError("Trying to addSameNode or CurrentAfterNode"); } }
public void AddAfter(DartChain dartChain, bool cascade = true) { //Check if we receive valid stuff if (AfterDartChain == null || (dartChain.GetInstanceID() != this.GetInstanceID() && dartChain.GetInstanceID() != AfterDartChain.GetInstanceID())) { //If cascading and there is a node to cascade if (cascade) { dartChain.AddBefore(this, false); } if (!MainRigidbody.isKinematic) { HingeJoint.connectedBody = dartChain.MainRigidbody; AfterDartChain = dartChain; } } else { Debug.LogError("Trying to addSameNode or CurrentAfterNode"); } }
private void InstantiateNewHose(DartChain beforeDartChain, DartChain afterDartChain) { var newHose = (DartChain) Instantiate(_dartChainPrefab, beforeDartChain.transform.position.Midpoint(afterDartChain.transform.position), transform.rotation); newHose.DartSource = DartSource; newHose.GunSource = GunSource; beforeDartChain.AddAfter(newHose); afterDartChain.AddBefore(newHose); Debug.Break(); }