Hi. Litle problem. Unity Editor hangs and must be restarted when am adding this script to gameobject. Hope am not blind. Why happens? What’s wrong with this code? Can anybody test it ? I create another project with same code but other name and unity hangs.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[ExecuteInEditMode]
public class A1 : MonoBehaviour
{
[Range(1, 360)]
public int _A = 2;
public int _C;
public int T;
public int[] Points;
public int[] X_;
public int[] Y_;
public int[] Z_;
private int Index_;
private int e;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Debug.Log("Work's");
Index_ = 0;
T = _A * _A;
_C = T * 3;
Points = new int[_C];
X_ = new int[T];
Y_ = new int[T];
Z_ = new int[T];
Cal();
}
void Cal()
{
Debug.Log("Cal(); -- Initiation");
for (e = 1; e <= _A; e++)
{
Debug.Log("Cal(); -- First Loop");
Debug.Log("j = " + e);
if (_A > 1) { Index_ = Index_ + 1; }
for (; Index_ <= e + 2;)
{
Debug.Log("Cal(); -- Secound Loop");
Debug.Log("Index_ = " + Index_);
}
}
}
}