Теми рефератів
> Реферати > Курсові роботи > Звіти з практики > Курсові проекти > Питання та відповіді > Ессе > Доклади > Учбові матеріали > Контрольні роботи > Методички > Лекції > Твори > Підручники > Статті Контакти
Реферати, твори, дипломи, практика » Курсовые проекты » Створення інтерактивної книги засобами Unity3d

Реферат Створення інтерактивної книги засобами Unity3d





;//The highest possible X coordinate of position.float minTimeBetweenSpawns;//The shortest possible time between spawns.float maxTimeBetweenSpawns;//The longest possible time between spawns.float minSpeed;//The lowest possible speed of the prop.float maxSpeed;//The highest possible speeed of the prop.Start ()

{( Spawn );

} Spawn ()

{waitTime=Random.Range (minTimeBetweenSpawns, maxTimeBetweenSpawns); return new WaitForSeconds (waitTime); posX=Random.Range (leftSpawnPosX, rightSpawnPosX); posY=upSpawnPosY; spawnPos=new Vector3 (posX, posY , transform.position.z); D propInstance=Instantiate (backgroundProp, spawnPos, Quaternion.identity) as Rigidbody2D; scale=propInstance.transform.localScale; .y *=- 1; .transform.localScale=scale; speed=Random. Range (minSpeed, maxSpeed); *=- 1f; .velocity=new Vector2 (0, speed); (Spawn ()); (propInstance!=null)

{(propInstance.transform.position.y lt; downSpawnPosY - 0.5f) (propInstance.gameObject); return null;

}

}

}. csUnityEngine; System.Collections; UnityEngine.UI; class EndScoreAchG2: MonoBehaviour {int language; text;

//Use this for initializationStart () {.HasKey ( Language );=PlayerPrefs.GetInt ( Language );=GetComponent lt; Text gt; ();

}

//Update is called once per frameUpdate () {= GetComponent lt; Text gt; (); (0 lt; startScoreG2.score amp; amp; 11 gt; startScoreG2.score) {(language == 0) {.text= Try Again raquo ;;

} (language == 1) {.text= Спробуй ще raquo ;;

}

} (startScoreG2.score gt; 10 amp; amp; 21 gt; startScoreG2.score) {(language == 0) {.text= Good raquo ;;

} (language == 1) {.text= Добре raquo ;;

}

} (startScoreG2.score gt; 25) {(language == 0) {.text= Excellent raquo ;;

} (language == 1) {.text= Розумничка raquo ;;

}}

}

}. csUnityEngine; System.Collections; Assets.Scripts; UnityEngine.UI; class Game: MonoBehaviour

{float fromleft; float ratio; int index; text;

//Use this for initializationStart ()

{(Screen.width == тисяча двадцять чотири amp; amp; Screen.height == 768 amp; amp; Screen.height gt; 650) {= 0.272f;=0.09f;

} if (Screen.width == 800 amp; amp; Screen.height == 480) {= 0.218f;=0.176f;

} if (Screen.width == 960 amp; amp; Screen.height == 540) {= 0.206f;=0.192f;

} if (Screen.width == 1280 amp; amp; Screen.height lt; 801 amp; amp; Screen.height gt; 720) {= 0.210f;=0.186f;

} if (Screen.width == 854 amp; amp; Screen.height == 480) {= 0.205f;=0.192f;

} {= 0.205f;=0.19f;

}=GameState.Start;

//random blank piece=Random.Range (0, Constants.MaxSize); [index] .SetActive (false);

//get the objects from the 1D array,

//convert them to Piece class and

//place them in a 2D array (int i=0; i lt; Constants.MaxColumns; i ++) {(int j=0; j lt; Constants.MaxRows; j ++) {(go [i * Constants.MaxColumns + j] .activeInHierarchy) {point=GetScreenCoordinatesFromVieport (i, j); [i * Constants.MaxColumns + j] .transform.position=point;

//place relevant information [i, j]=new Piece (); [i, j] .GameObject=go [i * Constants.MaxColumns + j]; [i, j] .OriginalI =i; [i, j] .OriginalJ=j;

//add a box collider the the raycast to work properly (Matrix [i, j] .GameObject.GetComponent lt; BoxCollider2D gt; () == null) [i, j] .GameObject.AddComponent lt; BoxCollider2D gt; ();

} else {[i, j]=null;// this will be our empty object

}

}

}

} void Shuffle ()

{

//shuffle (int i=0; i lt; Constants.MaxColumns; i ++)

{(int j=0; j lt; Constants.MaxRows; j ++)

{(Matrix [i, j] == null) continue; random_i=Random.Range (0, Constants.MaxColumns); random_j=Random.Range (0, Constants.MaxRows);

//swap'em (i, j, random_i, random_j);

}

}

} void Swap (int i, int j, int random_i, int random_j)

{

//temp piece, necessary for swappingtemp=Matrix [i, j]; [i, j]=Matrix [random_i, random_j]; [random_i, random_j]=temp;


Назад | сторінка 9 з 11 | Наступна сторінка





Схожі реферати:

  • Реферат на тему: Phonetic peculiarities of the popular science text
  • Реферат на тему: Grammar of the Text: its Basic Units and Main Features (based on the novel ...
  • Реферат на тему: Технології аналізу даних (Text Mining, Data Mining)
  • Реферат на тему: The types of extracurricular work in approach of foreign language
  • Реферат на тему: Foreign language in law