コード例 #1
0
ファイル: CableCoil.cs プロジェクト: ynot01/unitystation
    private void BuildCable(Vector3 position, Transform parent, Connection WireEndB)
    {
        Connection WireEndA = Connection.Overlap;
        GameObject Cable    = Spawn.ServerPrefab(CablePrefab, position, parent).GameObject;

        ElectricalCableMessage.Send(Cable, WireEndA, WireEndB, CableType);
        Cable.GetComponent <CableInheritance>().SetDirection(WireEndB, WireEndA, CableType);
    }
コード例 #2
0
    private void BuildCable(Vector3 position, Transform parent, Connection WireEndB)
    {
        Connection WireEndA = Connection.Overlap;
        GameObject Cable    = PoolManager.PoolNetworkInstantiate(CablePrefab, position, parent);

        ElectricalCableMessage.Send(Cable, WireEndA, WireEndB, CableType);
        Cable.GetComponent <CableInheritance>().SetDirection(WireEndB, WireEndA, CableType);
    }
コード例 #3
0
 public void FindOverlapsAndCombine()
 {
     if (WireEndA == Connection.Overlap | WireEndB == Connection.Overlap)
     {
         bool isA;
         if (WireEndA == Connection.Overlap)
         {
             isA = true;
         }
         else
         {
             isA = false;
         }
         List <ElectricalOIinheritance> Econns = new List <ElectricalOIinheritance>();
         var IEnumerableEconns = wireConnect.Matrix.GetElectricalConnections(wireConnect.registerTile.LocalPositionServer);
         foreach (var T in IEnumerableEconns)
         {
             Econns.Add(T);
         }
         int i = 0;
         if (Econns != null)
         {
             while (!(i >= Econns.Count))
             {
                 if (ApplianceType == Econns[i].InData.Categorytype)
                 {
                     if (wireConnect != Econns[i])
                     {
                         if (Econns[i].WireEndA == Connection.Overlap)
                         {
                             if (isA)
                             {
                                 WireEndA = Econns[i].WireEndB;
                             }
                             else
                             {
                                 WireEndB = Econns[i].WireEndB;
                             }
                             SetDirection(WireEndB, WireEndA, CableType);
                             ElectricalCableMessage.Send(gameObject, WireEndA, WireEndB, CableType);
                             Econns[i].gameObject.GetComponent <CableInheritance>().toDestroy();
                         }
                         else if (Econns[i].WireEndB == Connection.Overlap)
                         {
                             if (isA)
                             {
                                 WireEndA = Econns[i].WireEndA;
                             }
                             else
                             {
                                 WireEndB = Econns[i].WireEndA;
                             }
                             SetDirection(WireEndB, WireEndA, CableType);
                             ElectricalCableMessage.Send(gameObject, WireEndA, WireEndB, CableType);
                             Econns[i].gameObject.GetComponent <CableInheritance>().toDestroy();
                         }
                     }
                 }
                 i++;
             }
         }
     }
 }