Advertisement
SaloEater

Second Script

Apr 17th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEditor;
  4. using System;
  5. using System.Diagnostics;
  6.  
  7. public class runFilePath: MonoBehaviour {
  8.  
  9. public int amountOfPrPaths = 0; //кол-во сохраненных программ
  10.  
  11. public struct savePath { //Структура
  12. public string prPath;
  13. public int id;
  14. public AudioClip prAudioClip;
  15.  
  16. /*savePath(string pr, int idk) {
  17. prPath = pr;
  18. id = idk;
  19. }*/
  20. }
  21.  
  22. public savePath [] ProgsPath; //инициализация массива
  23.  
  24.  
  25. void OnGui() {
  26. GUI.Box(new Rect(400, 270, 150, 50), "ProgsPath[amountOfPrPaths].id");
  27. GUI.Box(new Rect(400, 330, 150, 50), "ProgsPath[amountOfPrPaths].prPath");
  28. }
  29.  
  30. void Start() {
  31. ProgsPath = new savePath[amountOfPrPaths];
  32. }
  33.  
  34. void Update() {
  35. if(GetComponent<Record>().canSave == true) {
  36. amountOfPrPaths = GetComponent<Record>().idPr;
  37. ProgsPath[amountOfPrPaths].id=amountOfPrPaths;
  38. ProgsPath[amountOfPrPaths].prAudioClip=GetComponent<Record>().bofferAudioClip;
  39. ProgsPath[amountOfPrPaths].prPath=GetComponent<Record>().path;
  40. }
  41.  
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement