示例#1
0
    private void Startup()
    {
        if (PlayerPrefs.HasKey("FirstRun"))
        {
            benderRadiusM         = PlayerPrefs.GetFloat("BenderRadiusM");
            conduitDiameterM      = PlayerPrefs.GetFloat("ConduitDiameterM");
            cameraRailSensitivity = PlayerPrefs.GetFloat("CameraRailSensitivity");
            cameraZoomSensitivity = PlayerPrefs.GetFloat("CameraZoomSensitivity");
            cameraTiltSensitivity = PlayerPrefs.GetFloat("CameraTiltSensitivity");
        }
        else
        {
            // Default Settings
            benderRadiusM         = 0.13652492625499998f;
            conduitDiameterM      = 0.023418787350159998f;
            cameraRailSensitivity = 0.5f;
            cameraZoomSensitivity = 0.5f;
            cameraTiltSensitivity = 0.5f;

            // First Time Application has been Run
            PlayerPrefs.SetInt("FirstRun", 1);
            PlayerPrefs.SetString("LastVersion", Application.version);
        }

        //------------------------
        // Initialize Components
        //------------------------
        bendFactory = new BendFactory();
        BendFactory.Initialize();

        bendManager = new BendManager();
        BendManager.Initialize();

        ConduitGenerator.degreesPerVerticeSet = 5f;
        ConduitGenerator.conduitDiameterM     = conduitDiameterM;
        ConduitGenerator.numberOfSides        = conduitSideCount;
        ConduitGenerator.Initialize();

        // Screen Manager is ultimately what will trigger 3d conduit generation
        screenManager.AddLinker(bendManager);
        screenManager.onEvent += ScreenManagerOnEvent;

        // Open Main Menu
        screenManager.OpenMain();
        //------------------------
        // Startup Sequence
        //------------------------
        //sequenceManager.RunSequence( "StartUpSequence" );
    }
示例#2
0
    public static void Initialize()
    {
        // TODO: Instead of Mapping all of these on Initialize and holding them in memory
        //      we could just Ask BendFactory for the Bend in Announce() and check if returned null
        //      To remedy saving, we could store the Bend Parameters in a File

        // Iterate through BendFactoryDelegates and Get/Map Bend Instances
        var names = BendFactory.GetBendNames();

        for (int i = 0; i < names.Count; ++i)
        {
            var bend = BendFactory.New(names[i]);
            if (bend != null)
            {
                m_Bends.Add(names[i], bend);
            }
        }

        // Load saved bends
        Load();
    }