コード例 #1
0
        public static void LoadChild(
            BinaryReader _reader,
            Version _version,
            List <ObjectInfo> _list,
            bool _import)
        {
            int num1 = _reader.ReadInt32();

            for (int index = 0; index < num1; ++index)
            {
                int num2 = _reader.ReadInt32();
                switch (num2)
                {
                case 0:
                    OICharInfo oiCharInfo = new OICharInfo((ChaFileControl)null, _import ? Studio.Studio.GetNewIndex() : -1);
                    oiCharInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiCharInfo);
                    break;

                case 1:
                    OIItemInfo oiItemInfo = new OIItemInfo(-1, -1, -1, _import ? Studio.Studio.GetNewIndex() : -1);
                    oiItemInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiItemInfo);
                    break;

                case 2:
                    OILightInfo oiLightInfo = new OILightInfo(-1, _import ? Studio.Studio.GetNewIndex() : -1);
                    oiLightInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiLightInfo);
                    break;

                case 3:
                    OIFolderInfo oiFolderInfo = new OIFolderInfo(_import ? Studio.Studio.GetNewIndex() : -1);
                    oiFolderInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiFolderInfo);
                    break;

                case 4:
                    OIRouteInfo oiRouteInfo = new OIRouteInfo(_import ? Studio.Studio.GetNewIndex() : -1);
                    oiRouteInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiRouteInfo);
                    break;

                case 5:
                    OICameraInfo oiCameraInfo = new OICameraInfo(_import ? Studio.Studio.GetNewIndex() : -1);
                    oiCameraInfo.Load(_reader, _version, _import, true);
                    _list.Add((ObjectInfo)oiCameraInfo);
                    break;

                default:
                    Debug.LogWarning((object)string.Format("おかしい情報が入っている : {0}", (object)num2));
                    break;
                }
            }
        }
コード例 #2
0
        public static OCILight Load(
            OILightInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode)
        {
            ChangeAmount _source  = _info.changeAmount.Clone();
            OCILight     ociLight = AddObjectLight.Load(_info, _parent, _parentNode, false, -1);

            _info.changeAmount.Copy(_source, true, true, true);
            return(ociLight);
        }
コード例 #3
0
        public static OCILight Load(
            OILightInfo _info,
            ObjectCtrlInfo _parent,
            TreeNodeObject _parentNode,
            bool _addInfo,
            int _initialPosition)
        {
            OCILight ociLight = new OCILight();

            Info.LightLoadInfo lightLoadInfo = (Info.LightLoadInfo)null;
            if (!Singleton <Info> .Instance.dicLightLoadInfo.TryGetValue(_info.no, out lightLoadInfo))
            {
                Debug.LogError((object)string.Format("存在しない番号[{0}]", (object)_info.no));
                return((OCILight)null);
            }
            ociLight.objectInfo = (ObjectInfo)_info;
            GameObject gameObject = Utility.LoadAsset <GameObject>(lightLoadInfo.bundlePath, lightLoadInfo.fileName, lightLoadInfo.manifest);

            gameObject.get_transform().SetParent(Singleton <Scene> .Instance.commonSpace.get_transform());
            ociLight.objectLight = gameObject;
            GuideObject guideObject = Singleton <GuideObjectManager> .Instance.Add(gameObject.get_transform(), _info.dicKey);

            guideObject.scaleSelect = 0.1f;
            guideObject.scaleRot    = 0.05f;
            guideObject.isActive    = false;
            guideObject.enableScale = false;
            guideObject.SetVisibleCenter(true);
            ociLight.guideObject = guideObject;
            ociLight.lightColor  = (LightColor)gameObject.GetComponent <LightColor>();
            if (Object.op_Implicit((Object)ociLight.lightColor))
            {
                ociLight.lightColor.color = _info.color;
            }
            ociLight.lightTarget = lightLoadInfo.target;
            switch (lightLoadInfo.target)
            {
            case Info.LightLoadInfo.Target.Chara:
                int num1 = ociLight.light.get_cullingMask() ^ LayerMask.GetMask(new string[2]
                {
                    "Map",
                    "MapNoShadow"
                });
                ociLight.light.set_cullingMask(num1);
                break;

            case Info.LightLoadInfo.Target.Map:
                int num2 = ociLight.light.get_cullingMask() ^ LayerMask.GetMask(new string[1]
                {
                    "Chara"
                });
                ociLight.light.set_cullingMask(num2);
                break;
            }
            if (_addInfo)
            {
                Studio.Studio.AddInfo((ObjectInfo)_info, (ObjectCtrlInfo)ociLight);
            }
            else
            {
                Studio.Studio.AddObjectCtrlInfo((ObjectCtrlInfo)ociLight);
            }
            TreeNodeObject _parent1       = !Object.op_Inequality((Object)_parentNode, (Object)null) ? (_parent == null ? (TreeNodeObject)null : _parent.treeNodeObject) : _parentNode;
            TreeNodeObject treeNodeObject = Studio.Studio.AddNode(lightLoadInfo.name, _parent1);

            treeNodeObject.enableAddChild          = false;
            treeNodeObject.treeState               = _info.treeState;
            guideObject.guideSelect.treeNodeObject = treeNodeObject;
            ociLight.treeNodeObject = treeNodeObject;
            if (_initialPosition == 1)
            {
                _info.changeAmount.pos = Singleton <Studio.Studio> .Instance.cameraCtrl.targetPos;
            }
            _info.changeAmount.OnChange();
            Studio.Studio.AddCtrlInfo((ObjectCtrlInfo)ociLight);
            _parent?.OnLoadAttach(!Object.op_Inequality((Object)_parentNode, (Object)null) ? _parent.treeNodeObject : _parentNode, (ObjectCtrlInfo)ociLight);
            ociLight.Update();
            return(ociLight);
        }