Esempio n. 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();
    }
Esempio n. 2
0
 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");
     }
 }
Esempio n. 3
0
    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");
        }
    }
Esempio n. 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();
 }