Example #1
0
    public void Generate()
    {
        m_gameProp = GameObject.FindGameObjectWithTag("GameProp").GetComponent <GameProperty_Spire>();
#if UNITY_EDITOR
        if (Application.isEditor || EditorApplication.isPlaying)
        {
            Random.InitState(m_gameProp.m_seed);
        }
#else
        Random.InitState(m_gameProp.m_seed);
#endif
        GenerateSpline();
        GenerateMeshes();
    }
Example #2
0
    // Use this for initialization
    void Start()
    {
        m_gameProp = GameObject.FindGameObjectWithTag("GameProp").GetComponent <GameProperty_Spire>();
        m_spire    = GameObject.FindGameObjectWithTag("Spire").GetComponent <SpireGenerator>();

        GameObject mainObj = GameObject.Find("Main");

        if (mainObj != null)
        {
            m_main = mainObj.GetComponent <Main>();
        }
        else
        {
            SceneManager.UnloadSceneAsync("SpireUp");
            SceneManager.LoadSceneAsync("Main");
        }

        m_boostVisuals = GetComponent <PlayerBoostVisuals>();

        // Adjust ball size
        transform.localScale = Vector3.one * m_gameProp.m_sphereRadius * 2.0f;
    }