Advertisement
Ramaraunt1

Untitled

Dec 22nd, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  5. // ABOUT //
  6. //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  7. /*
  8. * This file is a MissionTemplate Template (of the reduntant department of redundancy :D). MissionTemplates can be spawned in to allow the spawning
  9. * of new actors in a certain way, and are the basis of any RPG level.
  10. *
  11. * When copying this file to create a new mission template, be sure to rename the class name AND the file name to the same name, and to change this description
  12. * to explain what is in the template!
  13. *
  14. * - Ramaraunt
  15. */
  16.  
  17. //This class extends Monobehavior, and contains the base methods of Unity.
  18. #region MissionTemplates Class
  19. public class MissionTemplates : MonoBehaviour {
  20.  
  21. //Initialize spawners here. Say, for instance:
  22. // public GameObject spawner;
  23. //Then drag and drop the correct object to the script within Unity IDE.
  24. #region init spawners here
  25.  
  26. #endregion
  27.  
  28. //This is the part you edit to make new MTs!
  29. #region Editable Region
  30. //This method automatically runs when the object that contains this script is created.
  31. void Awake ()
  32. {
  33.  
  34. }
  35.  
  36. //This method is called once per frame of the game.
  37. void Update ()
  38. {
  39. //if you want to make something that occurs after a certain amount of time, go like this:
  40. /*
  41. *
  42. * if (Time.time >= <enter time here>)
  43. * {
  44. * Do stuff here!
  45. * }
  46. *
  47. */
  48. }
  49.  
  50. /*
  51. //Use this method if you are interested in having actors spawn in after a trigger has been hit!
  52. void onTriggerEnter()
  53. {
  54.  
  55. }
  56. */
  57.  
  58. #endregion
  59.  
  60. //This region contains background methods which are important for MTs to run correctly. DONT TOUCH THESE (unless you know what your doing and you have a good reason).
  61. //Please, feel free to look around though. :D
  62. #region Other Stuffs (no touchy)
  63.  
  64. //This region contains a series of utility methods, to be called up above and down bellow.
  65. #region Utilities
  66.  
  67. //This method grabs the prefab of a model, and returns it as a GameObject.
  68. private GameObject returnPrefabFromPath(string path)
  69. {
  70. return Resources.Load(path) as GameObject;
  71. }
  72.  
  73. //This method instantiates a prefab with the GameObject as an argument. It returns the GameObject. It has an overloaded method without rotation and position.
  74. private GameObject instantiatePrefabFromGameObject(Vector3 position, Quaternion rotation, GameObject objectToInstantiate)
  75. {
  76. return ((GameObject)Instantiate(objectToInstantiate, position, rotation));
  77. }
  78.  
  79. private GameObject instantiatePrefabFromGameObject(GameObject objectToInstantiate)
  80. {
  81. return ((GameObject)Instantiate(objectToInstantiate));
  82. }
  83.  
  84. // This method instantiates a game object from a path argument. It returns the GameObject. It has an overloaded method without rotation and position.
  85. private GameObject instantiatePrefabFromPath(Vector3 position, Quaternion rotation, string path)
  86. {
  87. return instantiatePrefabFromGameObject(position ,rotation, returnPrefabFromPath(path));
  88. }
  89.  
  90. private GameObject instantiatePrefabFromPath(string path)
  91. {
  92. return instantiatePrefabFromGameObject(returnPrefabFromPath(path));
  93. }
  94.  
  95. #endregion
  96.  
  97. //This region WILL contain stuff for AI calculations, but this isn't done yet!
  98. #region AI Stuffs
  99.  
  100. #endregion
  101.  
  102. //These methods are used for the actual creation of characters. Simply call these up above to make things happen!
  103. #region Actor Creation
  104.  
  105. //This method makes a naked person, using the default constructor of Actor, at the origin point of the scene. Mostly used for bugtesting.
  106. public bool makeNaked()
  107. {
  108. Actor person = new Actor();
  109.  
  110. if (person.getStatus())
  111. {
  112. //spawn the frame
  113.  
  114. }
  115. else
  116. {
  117. Debug.Log("Creation of Naked Actor failed!");
  118. }
  119.  
  120. return person.getStatus();
  121.  
  122. }
  123. #endregion
  124.  
  125. #endregion
  126. }
  127. #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement