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 AddBefore(DartChain dartChain, bool cascade = true) { //Check if we receive valid stuff if (BeforeDartChain == null || (dartChain.GetInstanceID() != this.GetInstanceID() && dartChain.GetInstanceID() != BeforeDartChain.GetInstanceID())) { //If cascading and there is no node to cascade if (cascade) { dartChain.AddAfter(this, false); } if (!MainRigidbody.isKinematic) { BeforeDartChain = dartChain; } } else { Debug.LogError("Trying to addSameNode or CurrentBeforeNode"); } }
public void AddBefore(DartChain dartChain, bool cascade = true) { //Check if we receive valid stuff if (BeforeDartChain == null ||( dartChain.GetInstanceID() != this.GetInstanceID() && dartChain.GetInstanceID() != BeforeDartChain.GetInstanceID())) { //If cascading and there is no node to cascade if (cascade) { dartChain.AddAfter(this, false); } if(!MainRigidbody.isKinematic) BeforeDartChain = dartChain; } else { Debug.LogError("Trying to addSameNode or CurrentBeforeNode"); } }
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(); }