コード例 #1
0
    void Start()
    {
        // Make sure everything is imported
        ResourceLoader.AttemptImport();

        foreach (RecipeData recipe in RecipeLibrary.All())
        {
            RecipeDisplay display = Instantiate(RecipeDisplay.DefaultDisplay, mContent.transform);
            display.mCurrentRecipe = recipe;
            mDisplays.Add(display);
        }
    }
コード例 #2
0
    void Start()
    {
        // Make sure material is setup and loaded (Is fine to call, as it won't reimport unless flag active)
        ResourceLoader.AttemptImport();

        // Only init, if hasn't already been forced to
        if (mImage == null)
        {
            // Start as empty
            mImage           = GetComponent <RawImage>();
            mImage.enabled   = false;
            mAmountText.text = "";

            // Make a copy of mesh (Unity doesn't allow for instanced materials in IO :/)
            mImage.material = Instantiate(mImage.material);
        }
    }
コード例 #3
0
    void Start()
    {
        if (Main == null)
        {
            Main = this;
            Debug.Log("World Manager created.");


            // Make sure library is initialized
            ResourceLoader.AttemptImport();
            mWorker = GetComponent <WorldWorker>();

            mCurrentTerrain = VoxelTerrain.New(-1);

            Entity_Player player = Resources.Load <Entity_Player>("Entities/Human/Player/Player Prefab");
            Instantiate(player.gameObject);
        }
        else
        {
            Debug.LogError("Cannot have multiple world managers active at once.");
            Destroy(gameObject);
        }
    }