cwisbg

Untitled

Mar 13th, 2019
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class MoPathPop : MonoBehaviour {
  6. public GameObject PathObj;
  7. public int DupAmnt;
  8. public bool DupChildAmnt;
  9. void Awake(){
  10. if (DupChildAmnt)
  11. {
  12. DupAmnt = transform.childCount;
  13. }
  14. for(int i = 0; i < DupAmnt; i++)
  15. {
  16. var PathObjDup = (GameObject)Instantiate(PathObj, transform.position, transform.rotation);
  17. PathObjDup.SetActive(true);
  18. MoPath PathObjDupMoPath = PathObjDup.GetComponent<MoPath>();
  19. PathObjDupMoPath.PositionListParent = transform.gameObject;
  20. }
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment