Beispiel #1
0
    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();
    }
Beispiel #2
0
 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");
     }
 }
Beispiel #3
0
    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");
        }
    }
Beispiel #4
0
 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();
 }