Exemplo n.º 1
0
        //設定されたオブジェクトを検索する
        internal GameObject FindTarget(TargetType targetType, string targetName)
        {
            switch (targetType)
            {
            case TargetType.MessageWindow:
                return(MessageWindow.gameObject);

            case TargetType.Graphics:
                return(Engine.GraphicManager.gameObject);

            case TargetType.Camera:
                if (string.IsNullOrEmpty(targetName) || targetName == TargetType.Camera.ToString())
                {
                    return(Engine.CameraManager.gameObject);
                }
                else
                {
                    CameraRoot camera = Engine.CameraManager.FindCameraRoot(targetName);
                    if (camera == null)
                    {
                        return(null);
                    }
                    else
                    {
                        return(camera.gameObject);
                    }
                }

            case TargetType.Default:
            default:
                return(Engine.GraphicManager.FindObjectOrLayer(targetName));
            }
        }
Exemplo n.º 2
0
        //セーブデータ用のバイナリ読み込み
        public void OnRead(BinaryReader reader)
        {
            int version = reader.ReadInt32();

            if (version < 0 || version > Version)
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
                return;
            }

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                string     name   = reader.ReadString();
                CameraRoot camera = FindCameraRoot(name);
                if (camera != null)
                {
                    reader.ReadBuffer(camera.Read);
                }
                else
                {
                    //セーブされていたが、消えているので読み込まない
                    reader.SkipBuffer();
                }
            }
        }
Exemplo n.º 3
0
        //設定されたオブジェクトを検索する
        internal GameObject FindTarget(TargetType targetType, string targetName)
        {
            switch (targetType)
            {
            case TargetType.MessageWindow:
                return(Engine.MessageWindowManager.UiMessageWindowManager.gameObject);

            case TargetType.Graphics:
                return(Engine.GraphicManager.gameObject);

            case TargetType.Camera:
                if (string.IsNullOrEmpty(targetName) || targetName == TargetType.Camera.ToString())
                {
                    return(Engine.CameraManager.gameObject);
                }
                else
                {
                    CameraRoot camera = Engine.CameraManager.FindCameraRoot(targetName);
                    if (camera == null)
                    {
                        return(null);
                    }
                    else
                    {
                        return(camera.gameObject);
                    }
                }

            case TargetType.Default:
            default:
                GameObject target = Engine.GraphicManager.FindObjectOrLayer(targetName);
                if (target != null)
                {
                    return(target);
                }
                else
                {
                    IAdvMessageWindow window;
                    if (Engine.MessageWindowManager.UiMessageWindowManager.AllWindows.TryGetValue(targetName, out window))
                    {
                        return(window.gameObject);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
        }
        internal void CreateCaptureImageObject(string name, string cameraName, string layerName)
        {
            AdvGraphicLayer layer = this.FindLayer(layerName);

            if (layer == null)
            {
                Debug.LogError(layerName + " is not layer name");
            }
            else
            {
                CameraRoot root = this.Engine.CameraManager.FindCameraRoot(cameraName);
                if (root == null)
                {
                    Debug.LogError(cameraName + " is not camera name");
                }
                else
                {
                    AdvGraphicInfo grapic = new AdvGraphicInfo("Capture", name, "2D");
                    layer.GetObjectCreateIfMissing(name, grapic).InitCaptureImage(grapic, root.LetterBoxCamera.CachedCamera);
                }
            }
        }
Exemplo n.º 5
0
        //指定のカメラのキャプチャ画像を撮って、それを表示するオブジェクトを作成
        internal void CreateCaptureImageObject(string name, string cameraName, string layerName)
        {
            AdvGraphicLayer layer = FindLayer(layerName);

            if (layer == null)
            {
                Debug.LogError(layerName + " is not layer name");
                return;
            }

            CameraRoot cameraRoot = Engine.CameraManager.FindCameraRoot(cameraName);

            if (cameraRoot == null)
            {
                Debug.LogError(cameraName + " is not camera name");
                return;
            }

            AdvGraphicInfo   grapic = new AdvGraphicInfo(AdvGraphicInfo.TypeCapture, name, AdvGraphicInfo.FileType2D);
            AdvGraphicObject obj    = layer.GetObjectCreateIfMissing(name, grapic);

            obj.InitCaptureImage(grapic, cameraRoot.LetterBoxCamera.CachedCamera);
        }