Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4.  
  5.  
  6.  
  7.  
  8. class przedmiot
  9. {
  10. public string nazwa = "";
  11. float waga = 10.0f;
  12.  
  13. void uzyj()
  14. {
  15.  
  16. }
  17.  
  18.  
  19.  
  20. }
  21.  
  22. public class NewScript : MonoBehaviour
  23. {
  24.  
  25. void funkcja1(int x, int y)
  26.  
  27.  
  28. {
  29. return x + y;
  30.  
  31. }
  32.  
  33.  
  34. // Use this for initialization
  35. void Start ()
  36. {
  37.  
  38. przedmiot krzeslo = new przedmiot();
  39. krzeslo.nazwa = "krzeslo";
  40. krzeslo.uzyj();
  41.  
  42. przedmiot stol = new przedmiot();
  43. stol.nazwa = "stol";
  44. stol.uzyj();
  45.  
  46. stol = krzeslo;
  47.  
  48. krzeslo.nazwa = "innekrzeslo";
  49.  
  50.  
  51. Debug.Log(stol.nazwa);
  52.  
  53. // przedmiot lodowka;
  54. // lodowka.nazwa = "costam";
  55. krzeslo = null
  56.  
  57.  
  58. int suma = funkcja1 (5, 10);
  59. funkcja1 (15, 20);
  60. int zmienna1 = 0;
  61. int zmienna2 = 1;
  62. funkcja1 (zmienna1, zmienna2);
  63.  
  64.  
  65. int liczba = 10;
  66. float liczbaulamkowa = 2.5f;
  67. double liczbaulamkowa2 = 2.5;
  68. string tekst = "Jakis tekst";
  69. bool flaga = true;
  70. char c = '5';
  71.  
  72.  
  73. // liczbaulamkowa = liczba;
  74. liczba = (int)liczbaulamkowa;
  75. string tekst2 = "200";
  76. int liczba2 = int.Parse(tekst2);
  77. string tekst3 = liczba2.ToString();
  78.  
  79.  
  80. int liczba5 = 10;
  81. int liczba6 = 20;
  82.  
  83. liczba5 = liczba6;
  84. liczba5 = liczba5 + liczba6;
  85. liczba5 = liczba5 * liczba6;
  86. liczba5 = 1 - 2;
  87. liczba5 = 10 / 3;
  88. float liczbaulamkowa3 = 10.0f / 3.0f;
  89. 5 = liczba5;
  90.  
  91. bool wynik = liczba5 == 1;
  92. wynik = liczba5 !=1;
  93. wynik = liczba5 > 0; // < <= >=
  94. wynik = !flaga;
  95. wynik = !(liczba5 == liczba6);
  96.  
  97.  
  98. if (liczba5 > 0)
  99. {
  100. Debug.Log("prawda);\t
  101. }
  102.  
  103.  
  104. else
  105. {
  106. Debug.Log("falsz")
  107. }
  108.  
  109.  
  110. Debug.Log(liczbaulamkowa3);
  111.  
  112.  
  113.  
  114. string nazwa = "jakasnazwa";
  115.  
  116.  
  117. }
  118.  
  119. // Update is called once per frame
  120. void Update () {
  121.  
  122. }
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement