Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Halo500 · Jan 29, 2014 at 04:22 AM · levelloadlevellevel-design

Load the Same Level, but Different Configurations?

Hi there everyone! I've made a horror app and I have had request to have different modes. The level is set within a forest, at night. People are asking for a daylight mode, and I am trying to implement a stormy version as well.

I've cloned the scene and add the changed preferences and added it into the selection of different level version. It works... but it dramatically increases the size of my app since I have the WHOLE SCENE duplicated again, for each version!

Is there a simple way (if possible in script form) of having the level preferences change, say when I'm at the main menu and there are 3 different versions of the level (night, day, storm) and all of them are the same level, but somehow they change? I've seen this before in other horror apps and the size of the app is definitely not as big as my app has become.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MikeNewall · Jan 29, 2014 at 04:45 AM 3
Share

Take a look at this :)

http://www.jacobpennock.com/Blog/?p=670

avatar image Halo500 · Jan 29, 2014 at 04:52 AM 0
Share

Thanks $$anonymous$$ike! I'll take a look at it. :D

avatar image Halo500 · Feb 16, 2014 at 08:26 PM 0
Share

Okay I have finally gone down a list of many things I've added to my game. Now I'm reading through this and trying to understand it.

I'm copying the scripts and I get this error:

 Assets/Level Selection/DialogueElement.cs(21,16): error CS0246: The type or namespace name `List' could not be found. Are you missing a using directive or an assembly reference?

I'm not sure what's going on. I'm following the tutorial and I got this error message...

avatar image getyour411 · Feb 16, 2014 at 08:33 PM 0
Share

You might need to add

 using System.Collections.Generic; 

to the top of that class to use List. Otherwise, show the relevant bits of code

avatar image Halo500 · Feb 16, 2014 at 08:40 PM 0
Share

I've came across that on the forums and done so, but the error still doesn't go away. Here's the script I've gotten together from the tutorial:

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 
 [System.Serializable]
 public class DialogueElement
 {
     public enum Characters{ $$anonymous$$, $$anonymous$$egan};
     public enum AvatarPos{ left, right};
     public Characters Character;
     public AvatarPos CharacterPosition;
     public Texture2D CharacterPic;
     public string DialogueText;
     public GUIStyle DialogueTextStyle;
     public float TextPlayBackSpeed;
     public AudioClip PlayBackSoundFile;
 }
 
 public class Dialogue: ScriptableObject
 {
     public List DialogItems;
 }

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by getyour411 · Feb 16, 2014 at 08:47 PM

Sample list declaration (adopt to your stuff)

 public List<QM_Skills> playerSkills = new List<QM_Skills> ();

http://unity3d.com/learn/tutorials/modules/intermediate/scripting/lists-and-dictionaries

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Halo500 · Feb 16, 2014 at 08:58 PM 0
Share

I've applied what you have given me and the error goes away:

 public class Dialogue: ScriptableObject
 {
     public List<DialogueElement> DialogItems = new List<DialogueElement> ();
 }

But now I get this error from the other script in the tutorial:

 Assets/Dialogue/Editor/DialogueAsset.cs(10,17): error CS0103: The name `ScriptableObjectUtility' does not exist in the current context


The "DialogueAsset.cs" is meant to be within an Editor Folder.

 using UnityEngine;
 using UnityEditor;
 using System;
 
 public class DialogueAsest
 {
     [$$anonymous$$enuItem("Assets/Create/Dialogue")]
     public static void CreateAsset ()
     {
         ScriptableObjectUtility.CreateAsset ();
     }
 }
avatar image getyour411 · Feb 16, 2014 at 09:09 PM 0
Share

Only place I find ScriptableObjectUtility is Unity wiki - do you have it?

http://wiki.unity3d.com/index.php?title=CreateScriptableObjectAsset

avatar image Halo500 · Feb 17, 2014 at 12:13 AM 0
Share

Whoo! That Wiki did it alright. Thanks a lot getyour411!

avatar image
0

Answer by Halo500 · Feb 17, 2014 at 09:02 PM

Okay, a new question has came up. I have done everything and fixed the scripts up a little bit to my liking for the Level Selection Configurations and I've made it VERY basic at the moment.

How do I apply it though? I've placed it on a Main Camera and press play, but the skybox does not change and the fog does not activate. (I'm much newer to C# than Javascript)

 using UnityEngine;
 using System.Collections;
 using System.Collections.Generic;
 
 [System.Serializable]
 public class LevelElement
 {
     public enum Levels{ Night, Day, Storm };
     //public enum AvatarPos{ left, right};
     public Levels Level;
     //public AvatarPos CharacterPosition;
     //public Texture2D LevelPic;
     //public string DialogueText;
     //public GUIStyle DialogueTextStyle;
     //public float TextPlayBackSpeed;
     //public AudioClip PlayBackSoundFile;
 
     public Material dayMaterial;
     public Material nightMaterial;
 
 void LevelSelection(){
     RenderSettings.skybox = nightMaterial;
     //RenderSettings.skybox = dayMaterial;
     RenderSettings.fog = true;
     //RenderSettings.fog = false;
     }
 }
 
 public class Level: ScriptableObject
 {
     public List<LevelElement> LevelItems = new List<LevelElement> ();
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Should player & pickups be children of the level, or keep them separate? 2 Answers

Load a random scene from a list of strings. 2 Answers

help please: Level Changing Scipt 1 Answer

Level freezes on loading dynamically 0 Answers

linking levels? 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges