Exemplo n.º 1
0
 void Start()
 {
     SetDirection(WireEndB, WireEndA, CableType);
     wireConnect = GetComponent <WireConnect>();
     wireConnect.ControllingCable = this;
     //StartCoroutine(WaitForLoad());
 }
Exemplo n.º 2
0
 public override void OnStartServer()
 {
     base.OnStartServer();
     wireConnect = GetComponent <WireConnect>();
     wireConnect.ControllingCable = this;
     StartCoroutine(WaitForLoad());
     _OnStartServer();
 }
Exemplo n.º 3
0
 public void Initialise(WireConnect DataToTake, MetaDataNode metaDataNode, Vector3Int searchVec, Matrix locatedon)
 {
     IsOn   = metaDataNode;
     InData = new IntrinsicElectronicData();
     InData.SetUp(DataToTake.InData);
     NodeLocation           = searchVec;
     Locatedon              = locatedon;
     InData.MetaDataPresent = this;
     InData.Present         = null;
 }
Exemplo n.º 4
0
    public void AddElectricalNode(Vector3Int position, WireConnect wireConnect)
    {
        var metaData = metaDataLayer.Get(position, true);
        var newdata  = new ElectricalMetaData();

        newdata.Initialise(wireConnect, metaData, position, this);
        metaData.ElectricalData.Add(newdata);

        UnderFloorElectricalSetTile(wireConnect.InData.WireEndA, wireConnect.InData.WireEndB,
                                    wireConnect.InData.Categorytype, position, newdata);
    }
Exemplo n.º 5
0
    public void AddElectricalNode(Vector3Int position, WireConnect wireConnect)
    {
        var metaData = metaDataLayer.Get(position, true);
        var newdata  = new ElectricalMetaData();

        newdata.Initialise(wireConnect, metaData, position, this);
        metaData.ElectricalData.Add(newdata);

        ElectricalCableTile Tile = null;
        string Compound;

        if (newdata.InData.WireEndA < newdata.InData.WireEndB)
        {
            Compound = newdata.InData.WireEndA + "_" + newdata.InData.WireEndB;
        }
        else
        {
            Compound = newdata.InData.WireEndB + "_" + newdata.InData.WireEndA;
        }
        int spriteIndex = WireDirections.GetSpriteIndex(Compound);

        switch (newdata.InData.Categorytype)
        {
        case PowerTypeCategory.StandardCable:
            Tile = ElectricalManager.Instance.MediumVoltageCables.Tiles[spriteIndex];
            break;

        case PowerTypeCategory.LowVoltageCable:
            Tile = ElectricalManager.Instance.LowVoltageCables.Tiles[spriteIndex];
            break;

        case PowerTypeCategory.HighVoltageCable:
            Tile = ElectricalManager.Instance.HighVoltageCables.Tiles[spriteIndex];
            break;
        }
        newdata.RelatedTile = Tile;
        if (Tile != null)
        {
            if (metaTileMap != null)
            {
                metaTileMap.SetTile(position, Tile);
            }
        }
    }
Exemplo n.º 6
0
    public void EditorAddElectricalNode(Vector3Int position, WireConnect wireConnect)
    {
        var ElectricalManager    = FindObjectOfType <ElectricalManager>();
        ElectricalCableTile Tile = null;
        string Compound;

        if (wireConnect.InData.WireEndA < wireConnect.InData.WireEndB)
        {
            Compound = wireConnect.InData.WireEndA + "_" + wireConnect.InData.WireEndB;
        }
        else
        {
            Compound = wireConnect.InData.WireEndB + "_" + wireConnect.InData.WireEndA;
        }
        int spriteIndex = WireDirections.GetSpriteIndex(Compound);

        switch (wireConnect.InData.Categorytype)
        {
        case PowerTypeCategory.StandardCable:
            Tile = ElectricalManager.MediumVoltageCables.Tiles[spriteIndex];
            break;

        case PowerTypeCategory.LowVoltageCable:
            Tile = ElectricalManager.LowVoltageCables.Tiles[spriteIndex];
            break;

        case PowerTypeCategory.HighVoltageCable:
            Tile = ElectricalManager.HighVoltageCables.Tiles[spriteIndex];
            break;
        }
        if (Tile != null)
        {
            if (metaTileMap != null)
            {
                metaTileMap.SetTile(position, Tile);
            }
        }
    }
Exemplo n.º 7
0
 private void Awake()
 {
     wireConnect = GetComponent <WireConnect>();
 }
Exemplo n.º 8
0
 public void EditorAddElectricalNode(Vector3Int position, WireConnect wireConnect)
 {
     UnderFloorElectricalSetTile(wireConnect.InData.WireEndA, wireConnect.InData.WireEndB,
                                 wireConnect.InData.Categorytype, position);
 }
Exemplo n.º 9
0
 void Awake()
 {
     wireConnect = GetComponent <WireConnect>();
     wireConnect.ControllingCable           = this;
     wireConnect.InData.ElectricityOverride = true;
 }