Giter Club home page Giter Club logo

unity-demo's People

Contributors

gizmotronn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

unity-demo's Issues

Prefabs not spawning on GameManager

As per the new function in TreeSpawner.cs:

    void SpawnTree(Vector3 position, GameObject[] availablePrefabs) {
        Vector3 truePos = new Vector3(position.x + (Random.value * MaxTreeOffset), position.y, position.z + (Random.value * MaxTreeOffset)); // Actual position of each prefab that will be spawned in
        GameObject treeObj = Instantiate(availablePrefabs[Random.Range(0, availablePrefabs.Length)], truePos, Quaternion.identity);
    }
}

Trees (which is the current demo option) should be spawning when running the GameManager - but they're not

This is what should be happening:
Screen Shot 2021-10-27 at 11 00 12 pm

At first I was thinking that there was more wrong with the current iteration but then I realised the seed and wave maps are just different, so the terrain is obviously going to be composed of different biomes. We just need to figure out why these prefabs aren't spawning on top - and then we need to figure out how to interact with the prefabs (as when the game ends, the prefabs disappear and will then be regenerated in a different PCG iteration).

This is what we've currently got:
Screen Shot 2021-10-27 at 11 14 08 pm
On the left we've got a height map with "island" configuration, on the right we've got a general biome setup.

Also in the above image, we see the ground material in the bottom right of the inspector which can be used in a similar role to this:

-L

Simple skill tree scene

Setting up a simple scene for the demo to get it to work on conjunction with the movement/pcg/demo content for Star Sailors

Chainsafe SDK Injection

WebLogin.cs script:

using System;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.SceneManagement;

#if UNITY_WEBGL
public class WebLogin : MonoBehaviour
{
    [DllImport("__Internal")]
    private static extern void Web3Connect();

    [DllImport("__Internal")]
    private static extern string ConnectAccount();

    [DllImport("__Internal")]
    private static extern void SetConnectAccount(string value);

    private int expirationTime;
    private string account; 

    public void OnLogin()
    {
        Web3Connect();
        OnConnected();
    }

    async private void OnConnected()
    {
        account = ConnectAccount();
        while (account == "") {
            await new WaitForSeconds(1f);
            account = ConnectAccount();
        };
        // save account for next scene
        PlayerPrefs.SetString("Account", account);
        // reset login message
        SetConnectAccount("");
        // load next scene
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }

    public void OnSkip()
    {
        // burner account for skipped sign in screen
        PlayerPrefs.SetString("Account", "");
        // move to next scene
        SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
    }
}
#endif

Set up integration with NPM & Pip for publishing our Unity assets

As we'll be creating & using a wide range of assets and packages for the construction of our game, I'm wanting to package these up into a set of packages that we can publish. Citizen Science, NLP/ml components, procedural generation (lidar), etc -> these are all components of "Star Sailors" that we'll be using across Unity, Phaser/.js, and in our hardware projects. I'll create a Notion document & link it here to keep track of all our prefabs and components so we can package them up in a way that makes it easy for other developers to use.

Usecases:

  • [Citizen Science] Data (manipulation & extrapolation) as a service
  • Visual scripting (like Scratch) for making games & apps using data
  • Traditional programming using predefined objects
    ++

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.