Advertisement
LittleAngel

Untitled

May 8th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class DemoScript : MonoBehaviour {
  5.  
  6. public Light myLight;
  7.  
  8. // Use this for initialization
  9. void Start () {
  10. int myVar = AddTwo (9,2);
  11. Debug.Log (myVar);
  12. }
  13.  
  14. // Update is called once per frame
  15. void Update () {
  16. if (Input.GetKeyDown("space")) {
  17. MyFunction ();
  18. }
  19. }
  20.  
  21. void MyFunction () {
  22. myLight.enabled = !myLight.enabled;
  23. int myVar = AddTwo (9,2);
  24. Debug.Log (myVar);
  25. }
  26.  
  27. int AddTwo (int var1, int var2) {
  28. int returnValue = var1 + var2;
  29. return returnValue;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement