Example #1
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]);
                    }
                }
            }
        }
Example #2
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);
                        }
                    }
                }
            }
        }