コード例 #1
0
    void GameStart(string name, GenericDictionary args)
    {
        float introductionDuration = args.Get("ConstructionTime") + 0.25f + args.Get("PhysicalActivationTime");

        SetHeightLevel(Mathf.Max(MyEventSystem.instance.Get("TowerHeight") - topOffset, initialCameraHeight), introductionDuration);
        cameraRotator.DORotate(new Vector3(0f, cameraRotator.eulerAngles.y + 360f, 0f), introductionDuration, RotateMode.FastBeyond360).SetEase(introductionRotationEase);
    }
コード例 #2
0
        protected override TextureFormat CreateFrameForGeneralTexture(TacticsOgreEFXTexture texture, int frame, GenericDictionary formatSpecificData, IList <System.Drawing.Image> images, System.Drawing.Image referenceImage, int mipmapsCount)
        {
            if (referenceImage != null || images.Count > 1)
            {
                throw new TextureFormatException("EFX texture should not contain multiple palettes!");
            }

            TextureFormat segment = null;

            var  image     = images.First();
            byte entryType = formatSpecificData.Get <byte>(ENTRY_TYPE_KEY);

            if (entryType != 0x52)
            {
                segment = new DummyTexture(string.Format("Data entry, type=0x{0:X}", entryType));
            }
            else
            {
                byte bpp = formatSpecificData.Get <byte>(BPP_KEY);

                segment = new PalettedTextureFormat.Builder()
                          .SetIndexCodec(IndexCodec.FromBitPerPixel(bpp))
                          .SetImageFilter(new SwizzleFilter(image.Width, image.Height, bpp))
                          .SetPaletteCodec(ColorCodec.CODEC_32BIT_RGBA)
                          .SetColorComparer(new ARGBColorComparer())
                          .Build(image);
            }

            texture.TextureFormats.Add(segment);

            return(segment);
        }
コード例 #3
0
ファイル: MyEventSystem.cs プロジェクト: Kissvane/TowerColor
    public dynamic Get(string key, dynamic defaultValue = default(dynamic), GenericDictionary options = null)
    {
        // First check for dynamic data callbacks
        if (_dynamicDataCallbacks.ContainsKey(key))
        {
            foreach (var pair in _dynamicDataCallbacks[key])
            {
                foreach (Func <GenericDictionary, dynamic> callback in pair.Value)
                {
                    dynamic result = callback(options);
                    if (result != null && !result.Equals(defaultValue))
                    {
                        return(result);
                    }
                }
            }
        }

        // Return from the database
        if (_dataBase.ContainsKey(key))
        {
            return(_dataBase.Get(key, defaultValue));
        }

        return(defaultValue);
    }
コード例 #4
0
        protected override TextureFormat CreateFrameForGeneralTexture(NamcoTexture texture, int frame, GenericDictionary formatSpecificData, IList <System.Drawing.Image> images, System.Drawing.Image referenceImage, int mipmapsCount)
        {
            TextureFormat segment = null;

            ushort version     = texture.FormatSpecificData.Get <ushort>(VERSION_KEY);
            byte   clutFormat  = formatSpecificData.Get <byte>(CLUTFORMAT_KEY);
            byte   depth       = formatSpecificData.Get <byte>(DEPTH_KEY);
            int    colorsCount = 1 << depth;

            int width  = images.First().Width;
            int height = images.First().Height;

            byte[] data     = formatSpecificData.Get <byte[]>(DATA_KEY);
            byte[] userData = formatSpecificData.Get <byte[]>(USERDATA_KEY);

            if (IsPaletted(clutFormat))
            {
                ColorCodec    paletteCodec;
                IndexCodec    indexCodec;
                ImageFilter   imgFilter;
                PaletteFilter palFilter;

                GetPalettedTools(version, clutFormat, depth, colorsCount, width, height, data, userData,
                                 out paletteCodec, out indexCodec, out imgFilter, out palFilter);

                var builder = new PalettedTextureFormat.Builder()
                              .SetPaletteCodec(paletteCodec)
                              .SetMipmapsCount(mipmapsCount)
                              .SetIndexCodec(indexCodec)
                              .SetImageFilter(imgFilter)
                              .SetPaletteFilter(palFilter);
                if (referenceImage != null)
                {
                    segment = builder.Build(referenceImage, images.Select(img => img.GetColorArray()).ToList());
                }
                else
                {
                    segment = builder.Build(images.First());
                }
            }
            else
            {
                ColorCodec  imageCodec;
                ImageFilter imgFilter;

                GetUnpalettedTools(version, clutFormat, depth, colorsCount, width, height, data, userData,
                                   out imageCodec, out imgFilter);

                segment = new GenericTextureFormat.Builder()
                          .SetColorCodec(imageCodec)
                          .SetMipmapsCount(mipmapsCount)
                          .SetImageFilter(imgFilter)
                          .Build(images.First());
            }

            texture.TextureFormats.Add(segment);

            return(segment);
        }
コード例 #5
0
        private void DoValueTest <K, V>(K key, V value)
        {
            GenericDictionary <K> dict = new GenericDictionary <K>();

            dict.Add(key, value);

            dict.Get <V>(key)
            .Should()
            .BeOfType(typeof(V));

            dict.Get <V>(key)
            .Should()
            .Be(value);
        }
コード例 #6
0
ファイル: UIManager.cs プロジェクト: Kissvane/TowerColor
    void FailConfirmation(string name, GenericDictionary args)
    {
        float failConfirmationTime = args.Get("failConfirmationTime");

        failConfirmationImage.transform.parent.gameObject.SetActive(true);
        failConfirmationImage.DOFillAmount(1f, failConfirmationTime);
    }
コード例 #7
0
 void TowerPartClicked(string name, GenericDictionary args)
 {
     if (canThrowBall)
     {
         ThrowBall(args.Get("destination"));
     }
 }
コード例 #8
0
ファイル: Tower.cs プロジェクト: Kissvane/TowerColor
    void ScoreUpdate(string name, GenericDictionary args)
    {
        TowerPart part = args.Get("DestructedTowerPart");

        foreach (Floor floor in towerConstructor.floors)
        {
            floor.TowerPartDestructed(part);
        }
    }
コード例 #9
0
 void ProgressiveDestruction(string name, GenericDictionary args = null)
 {
     StartCoroutine(ProgressiveDestruction(args.Get("GroupToDestroy")));
 }
コード例 #10
0
ファイル: Tower.cs プロジェクト: Kissvane/TowerColor
 void GameStart(string name, GenericDictionary args)
 {
     towerConstructor.Intialization(args.Get("ConstructionTime"), args.Get("PhysicalActivationTime"));
     StartCoroutine(ConstructTowerThenActivatePhysic());
 }
コード例 #11
0
ファイル: Test.cs プロジェクト: Kissvane/TowerColor
 dynamic Fonction3(GenericDictionary args)
 {
     return(args.Get("arg0") + args.Get("arg1"));
 }
コード例 #12
0
ファイル: Test.cs プロジェクト: Kissvane/TowerColor
 void Fonction2(string name, GenericDictionary arg)
 {
     Debug.Log("TEST2 " + (string)arg.Get("arg1"));
 }