Exemplo n.º 1
0
        public void Load()
        {
            SaveData save = SaveUtility.Load <SaveData>();

            carTransform.position    = save.carPosition;
            carTransform.eulerAngles = save.carRotation;

            interiorLight.lightState = save.interiorLightState;

            windowOpenerFL.windowState = save.windowOpenerFLstate;
            windowOpenerFR.windowState = save.windowOpenerFRstate;
            windowOpenerRL.windowState = save.windowOpenerRLstate;
            windowOpenerRR.windowState = save.windowOpenerRRstate;

            handbrake.handbrakeRot = save.handbrakePullUp;

            fuelTank.fuelLevel = save.fuelLevel;

            if (!save.playerHasKey)
            {
                interactionRaycast.rayDistance = 0f;
                keyManager.enabled             = true;
            }

            cdFix(save);
        }
Exemplo n.º 2
0
        public override void OnMenuLoad()
        {
            AssetBundle bundle = AssetBundle.CreateFromMemoryImmediate(Properties.Resources.edmmenucolls);

            MenuColls = GameObject.Instantiate <GameObject>(bundle.LoadAsset <GameObject>("MenuColls.prefab"));
            SaveData saveData = SaveUtility.Load <SaveData>();

            MenuColls.transform.position    = saveData.carPosition;
            MenuColls.transform.eulerAngles = saveData.carRotation;

            bundle.Unload(false);

            GameObject.DontDestroyOnLoad(MenuColls);
        }