예제 #1
0
        public void DrawBustshot(int layer, string textureName, int x, int y, int z, int oldx, int oldy, int oldz, bool move, int priority, int type, float wait, bool isblocking)
        {
            Layer i = GetLayer(layer);

            while (i.FadingOut)
            {
                i.HideLayer();
                i = GetLayer(layer);
            }
            if (!move)
            {
                oldx = x;
                oldy = y;
                oldz = z;
            }
            i.DrawLayer(textureName, oldx, oldy, oldz, null, 1f, /*isBustshot:*/ true, type, wait, isblocking);
            i.SetPriority(priority);
            if (move)
            {
                i.MoveLayer(x, y, z, 1f, 0, wait, isblocking, adjustAlpha: false);
            }
            iTween.Stop(i.gameObject);
            gameSystem.RegisterAction(delegate
            {
                if (i.UsingCrossShader() && i.gameObject.layer != GetActiveLayerMask())
                {
                    SetLayerActiveOnBothScenes(i);
                }
                else
                {
                    UpdateLayerMask(i, priority);
                }
            });
        }
예제 #2
0
 public void DrawSprite(int layer, string texture, string mask, int x, int y, int z, int originx, int originy, int angle, int style, float alpha, int priority, float wait, bool isblocking)
 {
     gameSystem.RegisterAction(delegate
     {
         Layer layer2 = GetLayer(layer);
         if (layer2.IsInUse)
         {
             layer2.ReleaseTextures();
         }
         UpdateLayerMask(layer2, priority);
         Vector2?origin = null;
         if (originx != 0 || originy != 0)
         {
             origin = new Vector2((float)originx, (float)originy);
         }
         layer2.DrawLayer(texture, x, y, z, origin, 1f - alpha, /*isBustshot:*/ false, 0, wait, isblocking);
         layer2.SetAngle((float)angle, 0f);
         layer2.SetPriority(priority);
         if (style == 1)
         {
             layer2.SwitchToAlphaShader();
         }
         gameSystem.ExecuteActions();
     });
 }
예제 #3
0
        public void DrawSpriteWithFiltering(int layer, string texture, string mask, int x, int y, int style, int priority, float wait, bool isBlocking)
        {
            Layer layer2 = GetLayer(layer);

            UpdateLayerMask(layer2, priority);
            layer2.DrawLayerWithMask(texture, mask, x, y, null, /*isBustshot:*/ false, style, wait, isBlocking);
            layer2.SetPriority(priority);
        }
예제 #4
0
 public void DrawFace(string texture, float wait, bool isblocking)
 {
     faceName = texture;
     if (Mathf.Approximately(wait, 0f))
     {
         isblocking = false;
     }
     faceLayer.DrawLayer(texture, 0, 0, 0, null, 1f, /*isBustshot:*/ false, 0, wait, isblocking);
     faceLayer.gameObject.layer = GetActiveLayerMask();
     if (faceToUpperLayer)
     {
         faceLayer.gameObject.layer = LayerMask.NameToLayer("Scene3");
     }
     faceLayer.SetPriority(63);
 }
예제 #5
0
        public void MODDrawBustshot(int layer, string textureName, Texture2D tex2d, int x, int y, int z, int oldx, int oldy, int oldz, bool move, int priority, int type, float wait, bool isblocking)
        {
            Layer layer2 = GetLayer(layer);

            while (layer2.FadingOut)
            {
                layer2.HideLayer();
                layer2 = GetLayer(layer);
            }
            if (!move)
            {
                oldx = x;
                oldy = y;
                oldz = z;
            }
            layer2.MODDrawLayer(textureName, tex2d, oldx, oldy, oldz, null, 1f, /*isBustshot:*/ true, type, wait, isblocking);
            layer2.SetPriority(priority);
            if (move)
            {
                layer2.MoveLayer(x, y, z, 1f, 0, wait, isblocking, adjustAlpha: false);
            }
            iTween.Stop(layer2.gameObject);
            if (Mathf.Approximately(wait, 0f))
            {
                layer2.FinishFade();
            }
            else
            {
                layer2.FadeInLayer(wait);
                if (isblocking)
                {
                    GameSystem.Instance.AddWait(new Wait(wait, WaitTypes.WaitForMove, layer2.FinishFade));
                }
                if (layer2.UsingCrossShader() && layer2.gameObject.layer != GetActiveLayerMask())
                {
                    SetLayerActiveOnBothScenes(layer2);
                }
                else
                {
                    UpdateLayerMask(layer2, priority);
                }
            }
        }
예제 #6
0
        public void DrawSprite(int layer, string texture, string mask, int x, int y, int z, int originx, int originy, int angle, int style, float alpha, int priority, float wait, bool isblocking)
        {
            Layer layer2 = GetLayer(layer);

            UpdateLayerMask(layer2, priority);
            Vector2?origin = null;

            if (originx != 0 || originy != 0)
            {
                origin = new Vector2((float)originx, (float)originy);
            }
            layer2.DrawLayer(texture, x, y, z, origin, 1f - alpha, /*isBustshot:*/ false, 0, wait, isblocking);
            layer2.SetAngle((float)angle, 0f);
            layer2.SetPriority(priority);
            if (style == 1)
            {
                layer2.SwitchToAlphaShader();
            }
        }
예제 #7
0
 public void DrawBustshotWithFiltering(int layer, string textureName, string mask, int x, int y, int z, int originx, int originy, int oldx, int oldy, int oldz, bool move, int priority, int type, float wait, bool isblocking)
 {
     gameSystem.RegisterAction(delegate
     {
         Layer layer2 = GetLayer(layer);
         while (layer2.FadingOut)
         {
             layer2.HideLayer();
             layer2 = GetLayer(layer);
         }
         if (!move)
         {
             oldx = x;
             oldy = y;
             oldz = z;
         }
         Vector2?origin = null;
         if (originx != 0 || originy != 0)
         {
             origin = new Vector2((float)originx, (float)originy);
         }
         layer2.DrawLayerWithMask(textureName, mask, oldx, oldy, origin, /*isBustshot:*/ true, type, wait, isblocking);
         layer2.SetPriority(priority);
         if (move)
         {
             layer2.MoveLayer(x, y, z, 1f, 0, wait, isblocking, adjustAlpha: false);
         }
         iTween.Stop(layer2.gameObject);
         if (layer2.UsingCrossShader() && layer2.gameObject.layer != GetActiveLayerMask())
         {
             SetLayerActiveOnBothScenes(layer2);
         }
         else
         {
             UpdateLayerMask(layer2, priority);
         }
         gameSystem.ExecuteActions();
     });
 }
예제 #8
0
        public void DeSerializeScene(MemoryStream ms)
        {
            BinaryReader binaryReader = new BinaryReader(ms);

            HideFilmEffector(0f, isBlocking: false);
            DrawScene("black", 0f);
            gameSystem.ExecuteActions();
            faceToUpperLayer  = binaryReader.ReadBoolean();
            useFilm           = binaryReader.ReadBoolean();
            useBlur           = binaryReader.ReadBoolean();
            useHorizontalBlur = binaryReader.ReadBoolean();
            filmPower         = binaryReader.ReadInt32();
            filmType          = binaryReader.ReadInt32();
            filmStyle         = binaryReader.ReadInt32();
            filmColor         = MGHelper.ReadColor(binaryReader);
            MGHelper.ReadVector3(binaryReader);
            MGHelper.ReadVector3(binaryReader);
            string backgroundfilename = binaryReader.ReadString();

            binaryReader.ReadSingle();
            binaryReader.ReadInt32();
            binaryReader.ReadInt32();
            DrawScene(backgroundfilename, 0.3f);
            if (binaryReader.ReadBoolean())
            {
                MGHelper.ReadVector3(binaryReader);
                MGHelper.ReadVector3(binaryReader);
                string texture = binaryReader.ReadString();
                binaryReader.ReadSingle();
                binaryReader.ReadInt32();
                binaryReader.ReadInt32();
                DrawFace(texture, 0f, isblocking: false);
            }
            for (int i = 0; i < 64; i++)
            {
                if (layers[i] != null && layers[i].IsInUse)
                {
                    layers[i].HideLayer();
                }
                if (binaryReader.ReadBoolean())
                {
                    Vector3 vector      = MGHelper.ReadVector3(binaryReader);
                    Vector3 scale       = MGHelper.ReadVector3(binaryReader);
                    string  textureName = binaryReader.ReadString();
                    float   alpha       = binaryReader.ReadSingle();
                    int     num         = binaryReader.ReadInt32();
                    int     type        = binaryReader.ReadInt32();
                    if (i != 50)
                    {
                        bool  isBustshot = num != 0;
                        Layer layer      = GetLayer(i);
                        UpdateLayerMask(layer, i);
                        layer.DrawLayer(textureName, (int)vector.x, (int)vector.y, 0, null, alpha, isBustshot, type, 0f, isBlocking: false);
                        layer.SetPriority(i);
                        layer.RestoreScaleAndPosition(scale, vector);
                    }
                }
            }
            if (useFilm)
            {
                CreateFilmEffector(filmType, filmColor, filmPower, filmStyle, 0f, isBlocking: false);
            }
            if (useHorizontalBlur)
            {
                CreateHorizontalGradation(filmPower, 0f, isBlocking: false);
            }
            SetFaceToUpperLayer(faceToUpperLayer);
            gameSystem.ExecuteActions();
        }