// Start is called before the first frame update
    void Start()
    {
        objStorage = new ObjectStorage(new TransferableObject
        {
            ObjectData = Instantiate(itemToTransfer)
        })
        {
            UniqueValue = "TestObject"
        };

        objDispenser = new ObjectDispenser();
        ViewableList = objStorage.hoardedObjects;
    }
    private void OnCopySettings(object data)
    {
        GameObject gameObject = (GameObject)data;

        if (!((UnityEngine.Object)gameObject == (UnityEngine.Object)null))
        {
            ObjectDispenser component = gameObject.GetComponent <ObjectDispenser>();
            if (!((UnityEngine.Object)component == (UnityEngine.Object)null))
            {
                UserMaxCapacity = component.UserMaxCapacity;
            }
        }
    }
Ejemplo n.º 3
0
    //Grabs the scripts that we are going to change values of from inside this script.
    void Start()
    {
        dispenser        = GameObject.Find("DispenserButton").GetComponent <ObjectDispenser> ();
        gravCon          = GameObject.Find("GravityManager").GetComponent <GravityController> ();
        uiScript         = GameObject.Find("InGameUI").GetComponent <UIScript> ();
        playerBody       = GetComponent <Rigidbody> ();
        cameraGameObject = Camera.main.gameObject;

        /*This part is only because of the pause menu. It makes sure you can move if you use the pause
         * menu to go back to the main menu you can move again after starting. Otherwise you wouldn't
         * be able to move if you go back to the main menu through this way. Because it doesn't reset
         * the timescale back to 1. */
        Time.timeScale = 1f;
    }
    public override void DoPostConfigureComplete(GameObject go)
    {
        ObjectDispenser objectDispenser = go.AddOrGet <ObjectDispenser>();

        objectDispenser.dropOffset = new CellOffset(1, 0);
        Prioritizable.AddRef(go);
        Storage storage = go.AddOrGet <Storage>();

        storage.showInUI          = true;
        storage.allowItemRemoval  = false;
        storage.showDescriptor    = true;
        storage.storageFilters    = STORAGEFILTERS.NOT_EDIBLE_SOLIDS;
        storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN;
        storage.fetchCategory     = Storage.FetchCategory.GeneralStorage;
        CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

        copyBuildingSettings.copyGroupTag = GameTags.StorageLocker;
        GeneratedBuildings.RegisterLogicPorts(go, INPUT_PORTS);
        Object.DestroyImmediate(go.GetComponent <LogicOperationalController>());
    }