/// <summary> /// Spawns a new Cell object /// A new Dot will be instantiated at the given site with the given rotation /// </summary> /// <param name="_site">The world position of this cell</param> /// <param name="_rotation">The rotation of this cell</param> /// <param name="_dotPrefab">The Prefab Dot to be spawned</param> /// <param name="_parent">NavMesh_CellGenerator object that this cell belongs to</param> public Cell(Vector3 _site, Quaternion _rotation, GameObject _dotPrefab, NavMesh_CellGenerator _parent) { site = _site; influenceValue = newInfluenceValue = wallInfluence = visibilityInfluence = currentFadeTime = 0.0f; parent = _parent; dot = UnityEngine.Object.Instantiate(_dotPrefab, site, _rotation); dotRenderer = dot.GetComponent <Renderer>(); dotRenderer.material.SetColor("_Color", Color.white); adjacentCells = new List <Pair <Cell, float> >(); }
public void SetParentAndIndex(NavMesh_CellGenerator _parent, int _index) { parent = _parent; index = _index; }