public void UnsuscribeUnit(GridSubscriber subscriber) { Vector2Int oldCell = subscriber.currentCell; if (oldCell.x >= 0 && oldCell.y >= 0 && oldCell.x < horizontalCell && oldCell.y < VerticalCell) { grid[oldCell.x, oldCell.y].Unsubscribe(subscriber.gameObject); } }
// Use this for initialization void Start() { gs = GetComponent <GridSubscriber>() as GridSubscriber; myself = GetComponent <Voisin>(); rb = GetComponent <Rigidbody2D>() as Rigidbody2D; tr = GetComponent <Transform>() as Transform; //if(m_PoidWandering > 0) // InvokeRepeating("WanderF", 1.0f, m_WanderRefresh); WanderF(); }