Ejemplo n.º 1
0
 public bool Deselect(OCILight _ociLight)
 {
     if (this.m_OCILight != _ociLight)
     {
         return(false);
     }
     this.ociLight = (OCILight)null;
     this.active   = false;
     return(true);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        public void AddLight(int _no)
        {
            OCILight ociLight = AddObjectLight.Add(_no);

            Singleton <UndoRedoManager> .Instance.Clear();

            if (Studio.Studio.optionSystem.autoHide)
            {
                this.rootButtonCtrl.OnClick(-1);
            }
            if (!Studio.Studio.optionSystem.autoSelect || ociLight == null)
            {
                return;
            }
            this.m_TreeNodeCtrl.SelectSingle(ociLight.treeNodeObject, true);
        }
Ejemplo n.º 4
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);
        }