コード例 #1
0
    void OnEnable()
    {
        Res.LoadAtlases(0, 1, 2);
        Res.LoadAtlases(1000, 1001, 1002);
        Res.LoadAtlases(2000, 2001, 2002, 2003);

        gpc = new GpController(Camera.main);

        gpc.AddImg(0, 1000);
        gpc.AddImg(1, 1001);
        gpc.AddImg(2, 1002);
        gpc.AddImg(3, 1003);
        gpc.AddImg(4, 1006);
        gpc.AddImg(5, 1007);
        gpc.AddImg(6, 1008);
        gpc.AddImg(7, 1009);
        gpc.AddImg(8, 1004);
        gpc.AddImg(9, 1005);
        gpc.AddImg(10, 1004);
        gpc.AddImg(11, 1005);
        gpc.AddImg(12, 1004);
        gpc.AddImg(13, 1005);

        gpc.SetImgAttr(0, ImgAttr.Position, 960f, 540f, 0f);
        gpc.SetImgAttr(0, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(1, ImgAttr.Position, 960f, 540f, -1f);
        gpc.SetImgAttr(1, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(2, ImgAttr.Position, 1336f, 301f, -2f);
        gpc.SetImgAttr(2, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(3, ImgAttr.Position, 1336f, 301f, -3f);
        gpc.SetImgAttr(3, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(4, ImgAttr.Position, 1678f, 866f, -1f);
        gpc.SetImgAttr(4, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(5, ImgAttr.Position, 1651f, 119f, -6f);
        gpc.SetImgAttr(5, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(6, ImgAttr.Position, 1651f, 119f, -7f);
        gpc.SetImgAttr(6, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(7, ImgAttr.Position, 688f, 401f, -3f);
        gpc.SetImgAttr(7, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(8, ImgAttr.Position, 167f, 183f, -4f);
        gpc.SetImgAttr(8, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(9, ImgAttr.Position, 167f, 183f, -4f);
        gpc.SetImgAttr(9, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(10, ImgAttr.Position, 714f, 189f, -4f);
        gpc.SetImgAttr(10, ImgAttr.Scale, 0.96f, 0.96f);
        gpc.SetImgAttr(10, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(11, ImgAttr.Position, 714f, 189f, -4f);
        gpc.SetImgAttr(11, ImgAttr.Scale, 0.96f, 0.96f);
        gpc.SetImgAttr(11, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(12, ImgAttr.Position, 1671f, 216f, -4f);
        gpc.SetImgAttr(12, ImgAttr.Scale, 0.78f, 0.78f);
        gpc.SetImgAttr(12, ImgAttr.Alpha, 1f);
        gpc.SetImgAttr(13, ImgAttr.Position, 1671f, 216f, -4f);
        gpc.SetImgAttr(13, ImgAttr.Scale, 0.78f, 0.78f);
        gpc.SetImgAttr(13, ImgAttr.Alpha, 1f);

        gpc.Wait(3f);
        gpc.SetImgAttrEased(1, ImgAttr.Tint, 0.5f, EsType.CubicIn, 1.0f, 0.4f, 0f);
        gpc.SetImgAttrEased(3, ImgAttr.Tint, 0.5f, EsType.CubicIn, 1.0f, 0.4f, 0f);
        gpc.SetImgAttrEased(6, ImgAttr.Tint, 0.5f, EsType.CubicIn, 1.0f, 0.4f, 0f);
        gpc.SetImgAttrEased(4, ImgAttr.Tint, 0.5f, EsType.CubicIn, 1.0f, 0.4f, 0f);

        StartCoroutine(TextAnimChange());

        /*
         * gpc.Wait(0.8f);
         * gpc.SetImgAttrEased(1, ImgAttr.Tint, 0.5f, EsType.CubicOut, 1.0f, 1.0f, 1.0f);
         * gpc.SetImgAttrEased(3, ImgAttr.Tint, 0.5f, EsType.CubicOut, 1.0f, 1.0f, 1.0f);
         * gpc.SetImgAttrEased(6, ImgAttr.Tint, 0.5f, EsType.CubicOut, 1.0f, 1.0f, 1.0f);
         * gpc.SetImgAttrEased(4, ImgAttr.Tint, 0.5f, EsType.CubicOut, 1.0f, 1.0f, 1.0f);
         */
        /*
         * gpc.AddImg(0, 2000);
         * gpc.AddImg(1, 2001);
         * gpc.AddImg(2, 2002);
         * gpc.AddImg(3, 2003);
         * gpc.AddImg(4, 2004);
         * gpc.AddImg(5, 2005);
         * gpc.AddImg(6, 2005);
         * gpc.AddImg(7, 2005);
         * gpc.AddImg(8, 2005);
         * gpc.AddImg(9, 2005);
         * gpc.AddImg(10, 2006);
         *
         * gpc.SetImgAttr(0, ImgAttr.Position, 640f, 540f, 0f);
         * gpc.SetImgAttr(0, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(1, ImgAttr.Position, 1920f, 540f, 0f);
         * gpc.SetImgAttr(1, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(2, ImgAttr.Position, 3200f, 540f, 0f);
         * gpc.SetImgAttr(2, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(3, ImgAttr.Position, 1809f, 363f, -1f);
         * gpc.SetImgAttr(3, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(4, ImgAttr.Position, 1809f, 363f, -1f);
         * gpc.SetImgAttr(5, ImgAttr.Position, 615f, 364f, -1f);
         * gpc.SetImgAttr(5, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(6, ImgAttr.Position, 986f, 364f, -1f);
         * gpc.SetImgAttr(6, ImgAttr.Scale, 0.7f, 0.7f);
         * gpc.SetImgAttr(6, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(7, ImgAttr.Position, 1291f, 364f, -1f);
         * gpc.SetImgAttr(7, ImgAttr.Scale, 0.46f, 0.46f);
         * gpc.SetImgAttr(7, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(8, ImgAttr.Position, 2716f, 364f, -1f);
         * gpc.SetImgAttr(8, ImgAttr.Scale, -0.7f, 0.7f);
         * gpc.SetImgAttr(8, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(9, ImgAttr.Position, 3089f, 364f, -1f);
         * gpc.SetImgAttr(9, ImgAttr.Scale, -1f, 1f);
         * gpc.SetImgAttr(9, ImgAttr.Alpha, 1f);
         * gpc.SetImgAttr(10, ImgAttr.Position, 1749f, 552f, -2f);
         *
         * gpc.Wait(3);
         * gpc.SetImgAttrEased(10, ImgAttr.Alpha, 1.0f, EsType.CubicIn, 1.0f);
         * gpc.SetImgAttrEased(4, ImgAttr.Alpha, 1.0f, EsType.CubicIn, 1.0f);
         */

        /*
         * for (int i = 0; i < 1; i += 1) {
         *      gpc.AddImg(1, 4);
         *
         *      gpc.SetImgAttr(1, ImgAttr.Position, 0f, 0f, 0f);
         *      gpc.SetImgAttr(1, ImgAttr.Rotation, 0f);·
         *      gpc.SetImgAttr(1, ImgAttr.Alpha, 1f);
         *      gpc.SetImgAttrEased(1, ImgAttr.Scale, 1f, EsType.ElasticOut, 0.01f, 0.01f);
         *      gpc.Wait(.5f);
         *      gpc.SetImgAttrEased(1, ImgAttr.Tint, 1.5f, EsType.ElasticOut, 1f, 0.5f, 1f);
         *      gpc.SetImgAttrEased(1, ImgAttr.Position, 2f, EsType.ElasticOut, 2f, -1f, 0f);
         *      gpc.Wait();
         *      gpc.SetImgAttrEased(1, ImgAttr.Tint, 1.5f, EsType.ElasticOut, 1f, 1f, 1f);
         *      gpc.SetImgAttrEased(1, ImgAttr.Position, 2f, EsType.ElasticOut, -2f, 2f, 0f);
         *      gpc.SetImgAttrEased(1, ImgAttr.Rotation, 1.5f, EsType.ElasticOut, Mathf.PI * 2.5f);
         *
         *      gpc.Wait(.5f);
         *      gpc.AddImg(2, 1);
         *      gpc.SetImgAttr(2, ImgAttr.Position, 0f, 0f, -5f);
         *      gpc.SetImgAttr(2, ImgAttr.Rotation, 0f);
         *      gpc.SetImgAttr(2, ImgAttr.Scale, 0.1f, 0.1f);
         *      gpc.SetImgAttr(2, ImgAttr.Alpha, 1f);
         *      gpc.SetImgAttrEased(2, ImgAttr.Scale, 1f, EsType.ElasticOut, 0.006f, 0.006f);
         *      gpc.SetImgAttrEased(2, ImgAttr.Position, 4f, EsType.ElasticOut, -2f, 2f, 0f);
         *
         *      gpc.Wait();
         *      gpc.SetImgAttrEased(1, ImgAttr.Tint, 1f, EsType.ElasticOut, 1.5f, 1.5f, 1.5f);
         *
         * }
         */
    }
コード例 #2
0
ファイル: Example.cs プロジェクト: DotLab/Futilef-Unity
    void OnEnable()
    {
        Res.LoadAtlases(10);

                #if GPC_TEST
        nodePool = Pool.New();

        nodeLst = PtrLst.New();
        PtrLst.Push(&nodePool->dependentLst, nodeLst);

        var sprite = (TpSprite *)Pool.Alloc(nodePool, sizeof(TpSprite));
        TpSprite.Init(sprite, Res.GetSpriteMeta(10001));

        var container = (Group *)Pool.Alloc(nodePool, sizeof(Group));
        Group.Init(container);
        PtrLst.Push(&nodePool->dependentLst, &container->childLst);

        PtrLst.Push(nodeLst, sprite);
        Vec4.Set(sprite->color, 1, 1, 1, 1);
        Vec2.Set(sprite->scl, .015f, .015f);

        DrawCtx.Start();
        var arr = (TpSprite **)nodeLst->arr;
        for (int i = 0, len = nodeLst->count; i < len; i += 1)
        {
            Node.Draw(arr[i], null, false);
        }
        DrawCtx.Finish();

        return;
                #endif

        gpc = new GpController(Camera.main);

        for (int i = 0; i < 5; i += 1)
        {
            gpc.SetCamAttr(CamAttr.Position, 0f, 0f);
            gpc.SetCamAttr(CamAttr.Zoom, 5f);

            gpc.AddImg(1, 10001);
            gpc.SetImgInteractable(1, (phase, x, y) => Debug.LogFormat("hit img1: phase {0}, x {1}, y {2}", phase, x, y));
            gpc.SetImgAttr(1, ImgAttr.Position, 0f, 0f, 0f);
            gpc.SetImgAttr(1, ImgAttr.Rotation, 0f);
            gpc.SetImgAttr(1, ImgAttr.Alpha, 1f);
            gpc.SetImgAttrEased(1, ImgAttr.Scale, 1f, EsType.ElasticOut, 0.01f, 0.01f);
            gpc.Wait(.5f);
            gpc.SetImgAttrEased(1, ImgAttr.Tint, 1.5f, EsType.ElasticOut, 1f, 0.5f, 1f);
            gpc.SetImgAttrEased(1, ImgAttr.Position, 2f, EsType.ElasticOut, 2f, -1f, 0f);
            gpc.Wait();
            gpc.SetImgAttrEased(1, ImgAttr.Tint, 1.5f, EsType.ElasticOut, 1f, 1f, 1f);
            gpc.SetImgAttrEased(1, ImgAttr.Position, 2f, EsType.ElasticOut, -2f, 2f, 0f);
            gpc.SetImgAttrEased(1, ImgAttr.Rotation, 1.5f, EsType.ElasticOut, Mathf.PI * 2.5f);

            gpc.SetCamAttrEased(CamAttr.Zoom, 1.5f, EsType.ElasticOut, 2f);
            gpc.SetCamAttrEased(CamAttr.Position, 2f, EsType.ElasticOut, -2f, 2f);

            gpc.Wait(.5f);
            gpc.AddImg(2, 10001);
            gpc.SetImgInteractable(2, (phase, x, y) => Debug.LogFormat("hit img2: phase {0}, x {1}, y {2}", phase, x, y));
            gpc.SetImgAttr(2, ImgAttr.Position, 0f, 0f, -5f);
            gpc.SetImgAttr(2, ImgAttr.Rotation, 0f);
            gpc.SetImgAttr(2, ImgAttr.Scale, 0.1f, 0.1f);
            gpc.SetImgAttr(2, ImgAttr.Alpha, 1f);
            gpc.SetImgAttrEased(2, ImgAttr.Scale, 1f, EsType.ElasticOut, 0.006f, 0.006f);
            gpc.SetImgAttrEased(2, ImgAttr.Position, 4f, EsType.ElasticOut, -2f, 2f, 0f);

            gpc.SetImgInteractable(1, null);

            gpc.Wait();
            gpc.SetImgId(2, 103);

            gpc.Wait();
            gpc.SetImgAttrEased(1, ImgAttr.Tint, 1f, EsType.ElasticOut, 1.5f, 1.5f, 1.5f);

            gpc.Wait();
            gpc.RmImg(1);
            gpc.RmImg(2);
        }

        Application.targetFrameRate = Screen.currentResolution.refreshRate;

                #if FDB
        Fdb.Test();
                #endif
    }
コード例 #3
0
 public StorySceneController(Camera camera)
 {
     _gpc     = new GpController(camera);
     _imgDict = new Dictionary <int, ImgData>();
 }