Esempio n. 1
0
        public void Update()
        {
            //try to add if needed
            if (m_bAddNeeded)
            {
                //mark that an add is no longer needed
                m_bAddNeeded = false;

                //check if there is an instance of the grid
                if (SearchCell == null &&
                    SearchGrid.Instance != null)
                {
                    //add this object to the instance
                    SearchGrid.AddObject(this);
                }
                else
                {
                    //no grid was found, warn
                    Debug.LogWarning("No SearchGrid was found, unable to add this SearchObject to a grid!");
                }
            }
        }