Exemplo n.º 1
0
    protected virtual void Start()
    {
        productionAccumulatedTime = 0;
        GameObject spaceStation = GameObject.FindWithTag("SpaceStation");

        if (spaceStation == null)
        {
            Debug.LogError("Unable to find SpaceStation gameObject to register \"" + gameObject.name + "\" machine!");
            return;
        }
        spaceStationManager = spaceStation.GetComponent <SpaceStationManager>();
        if (spaceStationManager == null)
        {
            Debug.LogError("Unable to find SpaceStation manager script to register \"" + gameObject.name + "\" machine!");
        }
        spaceStationManager.RegisterMachine(this);

        InvokeRepeating("Produce", resourceProductionFrequency, resourceProductionFrequency);
    }