Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class MoPathPop : MonoBehaviour {
- public GameObject PathObj;
- public int DupAmnt;
- public bool DupChildAmnt;
- void Awake(){
- if (DupChildAmnt)
- {
- DupAmnt = transform.childCount;
- }
- for(int i = 0; i < DupAmnt; i++)
- {
- var PathObjDup = (GameObject)Instantiate(PathObj, transform.position, transform.rotation);
- PathObjDup.SetActive(true);
- MoPath PathObjDupMoPath = PathObjDup.GetComponent<MoPath>();
- PathObjDupMoPath.PositionListParent = transform.gameObject;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment