Exemple #1
0
        private void FillTempGameObjectListByScene_SmallMap(GameObject gameObject)
        {
            var rootObject = gameObject;

            _tempTriggerCompList.Clear();
            rootObject.GetComponentsInChildren(true, _tempTriggerCompList);

            foreach (var comp in _tempTriggerCompList)
            {
                var go = comp.gameObject;

                if (_matcher != null && !_matcher(go))
                {
                    continue;
                }

                int objId = SceneTriggerObjectUtility.GetId(go);

                _logger.DebugFormat(" loadObj : {0} ,id:{1}", go, objId);
                _tempIdList.Add(objId);
                _tempGameObejctList.Add(go);

                int instacneid = gameObject.GetInstanceID();
                if (!_tempGameObjIdList.ContainsKey(instacneid))
                {
                    _tempGameObjIdList.Add(instacneid, objId);
                }
            }

            _tempTriggerCompList.Clear();
        }
Exemple #2
0
        private void FillTempGameObjectIdList(int index1, int index2)
        {
            var sceneId = SceneTriggerObjectUtility.GetSceneId(index1, index2);

            if (_sceneTriggerObjectIdList.ContainsKey(sceneId))
            {
                var idArray = _sceneTriggerObjectIdList[sceneId];
                if (idArray != null)
                {
                    var idCount = idArray.Length;
                    for (int i = 0; i < idCount; ++i)
                    {
                        _tempIdList.Add(idArray[i]);
                    }
                }
            }
        }
        private void FillTempGameObjectList_dynamic(GameObject gameObject)
        {
            var rootObject = gameObject;

            _tempTriggerCompList.Clear();
            rootObject.GetComponentsInChildren(true, _tempTriggerCompList);
            foreach (var comp in _tempTriggerCompList)
            {
                var go = comp.gameObject;
                if (_matcher != null && !_matcher(go))
                {
                    continue;
                }

                var id = SceneTriggerObjectUtility.GetId(go);
                _tempIdList.Add(id);
                _tempGameObejctList.Add(go);
            }

            _tempTriggerCompList.Clear();
        }
Exemple #4
0
        private void FillTempGameObjectList_dynamic(int index1, int index2, Scene scene)
        {
            var rootObjects = scene.GetRootGameObjects();

            foreach (var rootObject in rootObjects)
            {
                var comps = rootObject.GetComponentsInChildren(_triggerScriptType, true);
                for (int i = 0; i < comps.Length; ++i)
                {
                    var comp = comps[i];
                    var go   = comp.gameObject;
                    if (_matcher != null && !_matcher(go))
                    {
                        continue;
                    }

                    var id = SceneTriggerObjectUtility.GetId(_typeValue, index1, index2, _tempIdList.Count);
                    _tempIdList.Add(id);
                    _tempGameObejctList.Add(go);
                }
            }
        }
Exemple #5
0
        private void FillTempGameObjectList_static(int index1, int index2, Scene scene)
        {
            var rootObjects = scene.GetRootGameObjects();

            foreach (var rootObject in rootObjects)
            {
                if (rootObject.gameObject.name.Equals(_collectionObjectName))
                {
                    _messageArg[0] = _messageArg[1] = null;
                    rootObject.gameObject.SendMessage("ObjectCollection_Data", _messageArg, SendMessageOptions.DontRequireReceiver);
                    if (_messageArg[0] == null || _messageArg[1] == null)
                    {
                        continue;
                    }

                    var idArray         = (int[])_messageArg[0];
                    var gameObjectArray = (GameObject[])_messageArg[1];

                    _logger.DebugFormat("TriggerObject {0} List Load Count {1}", _collectionObjectName, idArray.Length);

                    AssertUtility.Assert(_tempIdList.Count == _tempGameObejctList.Count);

                    var sceneId = SceneTriggerObjectUtility.GetSceneId(index1, index2);
                    _sceneTriggerObjectIdList[sceneId] = idArray;

                    for (int i = 0; i < idArray.Length; ++i)
                    {
                        var go = gameObjectArray[i];
                        if (go != null)
                        {
                            _logger.DebugFormat("TriggerObject Load type {0} id {1} name {2}", _typeValue, idArray[i], go.name);
                            var id = SceneTriggerObjectUtility.GetId(_typeValue, index1, index2, idArray[i]);
                            _tempIdList.Add(id);
                            _tempGameObejctList.Add(go);
                        }
                    }
                }
            }
        }
        private void FillTempGameObjectIdList(GameObject gameObject)
        {
            var sceneId = SceneTriggerObjectUtility.GetId(gameObject);

            _tempIdList.Add(sceneId);
        }