Ejemplo n.º 1
0
    public override void SetSimulationProp(Circuit sim)
    {
        _analogSwitchComponent = sim.Create<SwitchSPST>();

        Connectors[0].DllConnector = _analogSwitchComponent.leadA;
        Connectors[1].DllConnector = _analogSwitchComponent.leadB;
    }
Ejemplo n.º 2
0
 // Called during instantiation
 public override void Awake()
 {
     if (CompareTag("ActiveItem"))
     {
         id = idCounter++;
         if (_analogSwitchEntity == null)
         {
             _analogSwitchEntity = new AnalogSwitchEntity {TurnedOff = DefaultState};
         }
         _analogSwitchComponent = new SwitchSPST();
         SetAndInitializeConnectors();
         
         GameObject componentIdManager = GameObject.Find("_ComponentIdManager");
         GenerateId script = componentIdManager.GetComponent<GenerateId>();
         script.generatedIds[7]++;
         _name += script.generatedIds[7].ToString();
     }
 }