コード例 #1
0
        //<summary>
        // Create an instance of LevelProperties, with the properties of the level set
        //</summary>
        static LevelProperties CreateInstance(string[] words, Vector3 backgroundPosn, float backgroundScale)
        {
            LevelProperties prop = ScriptableObject.CreateInstance <LevelProperties>();

            prop.Init(words, backgroundPosn, backgroundScale);
            return(prop);
        }
コード例 #2
0
        //Initialize scene - create objects and background
        //string level: name of level to load
        void LoadLevel(string level)
        {
            //Get properties of the level, including the words included in the level, the position of the background image,
            // and the desired scale of the background image
            LevelProperties prop = LevelProperties.GetLevelProperties(level);

            string[] words           = prop.Words();
            Vector3  backgroundPosn  = prop.BackgroundPosn();
            float    backgroundScale = prop.BackgroundScale();

            //Create word objects
            LevelCreation.CreateWordObjects(level, words);

            //Create background
            CreateBackGround(level, backgroundPosn, backgroundScale);
        }