void ResetMines() { Destroy(MineObj); MineObj = GameObject.Instantiate(MinePrefab, transform.position, transform.rotation); MineObj.transform.parent = transform; MineScript = MineObj.GetComponent <FinalBossMine>(); MineScript.MineType = MineType; ExplosionScript = MineObj.transform.GetChild(0).gameObject.GetComponent <FinalBossMineExplosion>(); ExplosionInitialSize = ExplosionScript.gameObject.transform.lossyScale; ExplosionScript.InitialScale = ExplosionInitialSize; ExplosionScript.ExplosionStart = false; MineScript.enabled = true; /*MineScript.transform.localPosition = new Vector3(0,0,0); * MineScript.gameObject.SetActive(true); * MineScript.TargetToChase = null; * MineScript.SetMineOff = false; * MineScript.StopOperationsNow = false; * MineScript.BeginOperationsNow = false; * MineScript.transform.localPosition = new Vector3(0, 0, 0); * ExplosionHappened = false; * ExplosionScript.transform.parent = MineScript.transform; * ExplosionScript.transform.localPosition = MineScript.transform.localPosition; * ExplosionScript.gameObject.SetActive(true); * ExplosionScript.ExplosionStart = false; * ExplosionScript.Start2 = false; * * ExplosionScript.transform.localPosition = MineScript.transform.localPosition; * ExplosionScript.gameObject.SetActive(false);*/ }
// Use this for initialization void Start() { MineObj = GameObject.Instantiate(MinePrefab, transform.position, transform.rotation); MineObj.transform.parent = transform; MineScript = MineObj.GetComponent <FinalBossMine>(); MineScript.MineType = MineType; ExplosionScript = MineObj.transform.GetChild(0).gameObject.GetComponent <FinalBossMineExplosion>(); ExplosionInitialSize = ExplosionScript.gameObject.transform.lossyScale; ExplosionScript.InitialScale = ExplosionInitialSize; ExplosionScript.ExplosionStart = false; MineScript.enabled = true; }