示例#1
0
 internal static void Animation_Init()
 {
     for (var i = 0; i < g_animations.Length; i++)
     {
         g_animations[i] = new CAnimation();                                           //memset(g_animations, 0, ANIMATION_MAX * sizeof(Animation));
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        startTime     = Time.time;
        sceneStartPos = transform.position - 3f * (fortViewPos - transform.position).normalized;
        //sceneStartRot = transform.
        maxDistStart    = (transform.position - fortViewPos).magnitude;
        maxDistRotation = (fortViewPos - gameViewPos).magnitude;

        animation = CAnimation.startingZoom;

        finishedFortLerp = false;
        startedGameLerp  = false;
        finishedGameLerp = false;
        playAnimation    = false;
        playedAnimation  = false;

        for (int i = 0; i < 11; i++)
        {
            //Debug.Log(exponentialCurve(i*0.1f));
        }

        if (PlayerPrefs.GetInt("InitTut", 0) == 0)
        {
            initialOverviewDone = false;
            StartCoroutine(InitialOverview());
        }
        else
        {
            initialOverviewDone = true;
        }
    }
示例#3
0
    static uint s_animationTimer; /*!< Timer for animations. */

    /*
     * Stop with this Animation.
     * @param animation The Animation to stop.
     * @param parameter Not used.
     */
    static void Animation_Func_Stop(CAnimation animation)
    {
        var layout          = g_table_structure_layoutTiles[animation.tileLayout];
        var layoutTileCount = g_table_structure_layoutTileCount[animation.tileLayout];
        var packed          = Tile_PackTile(animation.tile);
        int i;
        var layoutPointer = 0;

        g_map[packed].hasAnimation = false;
        animation.commands         = null;

        for (i = 0; i < layoutTileCount; i++)
        {
            var position = (ushort)(packed + layout[layoutPointer++]);
            var t        = g_map[position];

            if (animation.tileLayout != 0)
            {
                t.groundTileID = g_mapTileID[position];
            }

            if (Map_IsPositionUnveiled(position))
            {
                t.overlayTileID = 0;
            }

            Map_Update(position, 0, false);
        }
    }
示例#4
0
 public void OnAnimationFinish(CAnimation animation)
 {
     if (animation.GetType() == EAnimations.Highlight)
     {
         StartDying();
     }
 }
示例#5
0
    //-------------------------------------------------------------------------------
    ///
    //-------------------------------------------------------------------------------
    public CPlayer(Vector2 posInit, bool bIsMainCharacter = false)
    {
        game = GameObject.Find("_Game").GetComponent <CGame>();
        GameObject prefab = game.prefabPlayer;

        m_GameObject = GameObject.Instantiate(prefab) as GameObject;
        SetPosition2D(posInit);

        m_ConeVision = m_GameObject.GetComponent <CConeVision>();
        m_CameraCone = game.m_CameraCone;

        m_fSpeed      = game.m_fSpeedPlayer;
        m_spriteSheet = new CSpriteSheet(m_GameObject);         // m_GameObject.GetComponent<CSpriteSheet>();

        m_AnimRepos = new CAnimation(game.m_materialPlayerRepos, 1, 1, 1.0f);

        m_AnimHorizontal = new CAnimation(game.m_materialPlayerHorizontal, 6, 1, 6.0f, new string[] { "", "", "Play_Foost", "", "", "Play_Foost" });

        m_AnimVertical = new CAnimation(game.m_materialPlayerVertical, 6, 1, 2.0f);

        m_eMoveModState      = EMoveModState.e_MoveModState_marche;
        m_bMainCharacter     = bIsMainCharacter;
        m_YounesSuceDesBites = null;
        m_bHaveObject        = false;

        m_Torche = m_GameObject.transform.FindChild("Torche").gameObject;

        m_CercleDiscretion = m_GameObject.transform.FindChild("CercleDiscretion").GetComponent <CCercleDiscretion>();
    }
示例#6
0
        public void OnTransformExplosionStart(CAnimation animation)
        {
            CGame.Sounds.explosion.Play();

            CAnimations
            .Explosion(icon.transform.position)
            .SetColor(icon.color);
        }
示例#7
0
 public void OnTransformBoltStart(CAnimation animation)
 {
     CAnimations
     .Contour(icon.transform.position)
     .SetColor(icon.color)
     .SetListener(this);
     observer.OnDieBolt();
 }
示例#8
0
    /*
     * Abort this Animation.
     * @param animation The Animation to abort.
     * @param parameter Not used.
     */
    static void Animation_Func_Abort(CAnimation animation)
    {
        var packed = Tile_PackTile(animation.tile);

        g_map[packed].hasAnimation = false;
        animation.commands         = null;

        Map_Update(packed, 0, false);
    }
    void Update()
    {
        if (Time.time - startTime > 1.5f && !finishedFortLerp && initialOverviewDone)
        {
            transform.position = Vector3.Lerp(transform.position, fortViewPos, 2f * SInterpolate() * Time.deltaTime);
            transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.Euler(fortViewRot), 2f * SInterpolate() * Time.deltaTime);
        }

        if ((transform.position - fortViewPos).magnitude < 5f)
        {
            finishedFortLerp = true;
            startedGameLerp  = true;
            animation        = CAnimation.rotation;
        }

        if (startedGameLerp)
        {
            if (!finishedGameLerp)
            {
                Vector3 slerpCenter = new Vector3(13.6f, 12.73f, -6.88f);
                transform.position = slerpCenter + Vector3.Slerp((transform.position - slerpCenter), (gameViewPos - slerpCenter), Time.deltaTime);

                Vector3    directionToTarget = (focusPoint - transform.position).normalized;
                Quaternion lookRotation      = Quaternion.LookRotation(directionToTarget);

                transform.rotation = Quaternion.Slerp(transform.rotation, lookRotation, 4f * Time.deltaTime);
            }


            if ((transform.position - gameViewPos).magnitude < 5f & !finishedGameLerp)
            {
                focusPoint = Vector3.Lerp(focusPoint, focusPoint + Vector3.forward, 10f * Time.deltaTime);

                if (transform.rotation.eulerAngles.x < 25f)
                {
                    finishedGameLerp = true;
                }
            }
        }

        if (finishedGameLerp)
        {
            FindObjectOfType <EnemySpawner>().startNextWave = true;
            if (!musicPlayed)
            {
                music.Play(0); musicPlayed = true;
            }
            playAnimation = true;
        }
        if (playAnimation & !playedAnimation)
        {
            FindObjectOfType <WaveAnimation>().OnBetweenWaves();
            playedAnimation = true;
        }

        //Debug.Log(finishedGameLerp);
    }
示例#10
0
 /// <summary>
 /// Sets a new animation.
 /// </summary>
 /// <param name='anim'>
 /// The animation to set
 /// </param>
 public void SetAnimation(CAnimation anim)
 {
     m_nColumns            = anim.m_nColumns;
     m_nRows               = anim.m_nRows;
     m_Size                = new Vector2(1.0f / m_nColumns, 1.0f / m_nRows);
     m_myRenderer.material = anim.m_Material;
     m_myRenderer.material.SetTextureScale("_MainTex", m_Size);
     m_fFPS   = anim.m_fFPS;
     m_sounds = anim.m_sounds;
 }
示例#11
0
 void UpdateFunc()
 {
     owner = target as CAnimation;
     SampleFrame();
     if (!isGenAnimInfos)
     {
         EditorApplication.update = null;
         SampleFrame();
     }
 }
示例#12
0
        //* -----------------------------------------------------------------------*
        /// <summary>1フレーム分の更新処理を実行します。</summary>
        ///
        /// <param name="entity">この状態を適用されているオブジェクト。</param>
        /// <param name="privateMembers">
        /// オブジェクトと状態クラスのみがアクセス可能なフィールド。
        /// </param>
        /// <param name="gameTime">前フレームが開始してからの経過時間。</param>
        public override void update(
            CAnimation <_T, _D> entity, object privateMembers, GameTime gameTime)
        {
            _T now = entity.nowScene;

            if (entity.counter >= now.interval)
            {
                entity.resetCounter();
                entity.index += now.next;
            }
        }
示例#13
0
    /*
     * Set the ground sprite of the tile.
     * @param animation The Animation for which we change the ground sprite.
     * @param parameter The offset in the iconGroup to which the ground sprite is set.
     */
    static void Animation_Func_SetGroundTile(CAnimation animation, short parameter)
    {
        var           specialMap = new ushort[1];
        Span <ushort> iconMap;
        var           layout          = g_table_structure_layoutTiles[animation.tileLayout];
        var           layoutTileCount = g_table_structure_layoutTileCount[animation.tileLayout];
        var           packed          = Tile_PackTile(animation.tile);
        int           i;
        var           layoutPointer  = 0;
        var           iconMapPointer = 0;

        iconMap = g_iconMap.AsSpan(g_iconMap[animation.iconGroup] + layoutTileCount * parameter);

        /* Some special case for turrets */
        if ((parameter > 1) && (animation.iconGroup == (byte)IconMapEntries.ICM_ICONGROUP_BASE_DEFENSE_TURRET || animation.iconGroup == (byte)IconMapEntries.ICM_ICONGROUP_BASE_ROCKET_TURRET))
        {
            var s = Structure_Get_ByPackedTile(packed);
            Debug.Assert(s != null);
            Debug.Assert(layoutTileCount == 1);

            specialMap[0] = (ushort)(s.rotationSpriteDiff + g_iconMap[g_iconMap[animation.iconGroup]] + 2);
            iconMap       = specialMap;
        }

        for (i = 0; i < layoutTileCount; i++)
        {
            var position = (ushort)(packed + layout[layoutPointer++]);
            var tileID   = iconMap[iconMapPointer++];
            var t        = g_map[position];

            if (t.groundTileID == tileID)
            {
                continue;
            }
            t.groundTileID = tileID;
            t.houseID      = animation.houseID;

            if (Map_IsPositionUnveiled(position))
            {
                t.overlayTileID = 0;
            }

            Map_Update(position, 0, false);

            Map_MarkTileDirty(position);
        }
    }
示例#14
0
    /*
     * Set the overlay sprite of the tile.
     * @param animation The Animation for which we change the overlay sprite.
     * @param parameter The TileID to which the overlay sprite is set.
     */
    static void Animation_Func_SetOverlayTile(CAnimation animation, short parameter)
    {
        var packed = Tile_PackTile(animation.tile);
        var t      = g_map[packed];

        Debug.Assert(parameter >= 0);

        if (!Map_IsPositionUnveiled(packed))
        {
            return;
        }

        t.overlayTileID = g_iconMap[g_iconMap[animation.iconGroup] + parameter];
        t.houseID       = animation.houseID;

        Map_Update(packed, 0, false);
    }
示例#15
0
    //-------------------------------------------------------------------------------
    /// Unity
    //-------------------------------------------------------------------------------
    void Start()
    {
        game          = GameObject.Find("_Game").GetComponent <CGame>();
        m_spriteSheet = new CSpriteSheet(gameObject);
        m_spriteSheet.Init();
        m_openAnimation = new CAnimation(m_openMat, 4, 1, 2.0f);
        m_spriteSheet.SetAnimation(m_openAnimation);
        m_spriteSheet.setEndCondition(CSpriteSheet.EEndCondition.e_PingPong);
        m_objCamera = GameObject.Find("Cameras");
        m_bGoodWay  = true;

        m_enter_att = new GameObject();
        m_exit_att  = new GameObject();

        m_enter_att.transform.parent   = m_exit_att.transform.parent = gameObject.transform;
        m_enter_att.transform.position = m_exit_att.transform.position = transform.position;

        m_enter_att.transform.rotation = m_exit_att.transform.rotation = transform.rotation;
        m_exit_att.transform.Rotate(0, 0, 180);

        m_enter_att.AddComponent <CPorteAttenuation>().Init(m_PieceExit, m_PieceEnter, attenuation_enter_size);
        m_exit_att.AddComponent <CPorteAttenuation>().Init(m_PieceEnter, m_PieceExit, attenuation_exit_size);
    }
示例#16
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        owner = target as CAnimation;
        if (GUILayout.Button("GenList"))
        {
            isGenAnimInfos = true;
            OnBeginGen();
            EditorApplication.update += UpdateFunc;
        }

        if (GUILayout.Button("SetTimer"))
        {
            owner.SetTime(owner.debugTimer);
        }

        if (GUILayout.Button("PE_RadialBlur"))
        {
            PostEffectManager.StartEffect(EPostEffectType.RadialBlur, owner.shaderDuration, owner.shaderFadeInTime,
                                          owner.shaderFadeOutTime
                                          , new PostEffectRadialBlur.ParamsInfo(owner.shadersSampleDist, owner.shadersSampleStrength));
        }
    }
        private void Compile(Animation src)
        {
            var canimation = new CAnimation();

            canimation.Dependency         = (int)src.Dependency;
            canimation.FramesPerUnitRatio = src.FramesPerUnitRatio;
            Writer.WriteStruct(canimation);

            Writer.Write(src.Count);
            foreach (var frame in src.Frames)
            {
                for (int n = 0; n < frame.Count; n++)
                {
                    var node  = frame[n];
                    var cnode = new CFrameNode();
                    cnode.Properties = (int)node.Properties;
                    cnode.OffsetX    = node.OffsetX;
                    cnode.OffsetY    = node.OffsetY;
                    cnode.Angle      = node.Angle;
                    Writer.WriteStruct(cnode);
                }
            }
        }
示例#18
0
 //* -----------------------------------------------------------------------*
 /// <summary>1フレーム分の描画処理を実行します。</summary>
 ///
 /// <param name="entity">この状態を適用されているオブジェクト。</param>
 /// <param name="privateMembers">
 /// オブジェクトと状態クラスのみがアクセス可能なフィールド。
 /// </param>
 /// <param name="gameTime">前フレームが開始してからの経過時間。</param>
 public override void draw(
     CAnimation <_T, _D> entity, object privateMembers, GameTime gameTime)
 {
 }
示例#19
0
        //* ────________________________________*
        //* methods ───────────────────────────────-*

        //* -----------------------------------------------------------------------*
        /// <summary>
        /// <para>状態が開始された時に呼び出されます。</para>
        /// <para>このメソッドは、遷移元の<c>teardown</c>よりも後に呼び出されます。</para>
        /// </summary>
        ///
        /// <param name="entity">この状態を適用されたオブジェクト。</param>
        /// <param name="privateMembers">
        /// オブジェクトと状態クラスのみがアクセス可能なフィールド。
        /// </param>
        public override void setup(CAnimation <_T, _D> entity, object privateMembers)
        {
            entity.resetCounter();
        }
示例#20
0
 //* -----------------------------------------------------------------------*
 /// <summary>
 /// <para>オブジェクトが別の状態へ移行する時に呼び出されます。</para>
 /// <para>このメソッドは、遷移先の<c>setup</c>よりも先に呼び出されます。</para>
 /// </summary>
 ///
 /// <param name="entity">この状態を終了したオブジェクト。</param>
 /// <param name="privateMembers">
 /// オブジェクトと状態クラスのみがアクセス可能なフィールド。
 /// </param>
 /// <param name="nextState">オブジェクトが次に適用する状態。</param>
 public override void teardown(
     CAnimation <_T, _D> entity, object privateMembers, IState nextState)
 {
 }
示例#21
0
文件: Player.cs 项目: CarimA/RPG
        public Player(Config config, IAssetLoader assetLoader)
        {
            Name = "Player";

            PlayerData = new PlayerData();
            Components.Add(PlayerData.Position);

            CanMove = true;

            Components.Add(CCollisionBound.Circle(8, 6));
            Components.Add(new CSize(new Vector2(16, 16)));
            Components.Add(Input = new CInputState());
            Components.Add(new CKeyboard(config.ControlsKeyboard));
            Components.Add(new CController(PlayerIndex.One, config.ControlsGamepad, config.Deadzone / 100f));
            Components.Add(new CInputPriority(InputPriority.GamePad));
            Components.Add(new CTarget());
            Components.Add(new CRunning());
            Components.Add(new CSprite(assetLoader.Get <Texture2D>("sprites/player.png"), new Vector2(16, 32)));
            Components.Add(new CMapEntity());
            Components.Add(new CMaskEntity());
            Components.Add(new CFringeEntity {
                Opacity = 0.35f
            });

            var animation = new CAnimation()
            {
                Loop = true
            };

            animation.AddAnimation("idle-down", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(0, 0, 32, 48), 0f)
            });

            animation.AddAnimation("walk-down", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 0, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(64, 0, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(96, 0, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(128, 0, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(160, 0, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(192, 0, 32, 48), 0.135f)
            });

            animation.AddAnimation("run-down", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 0, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(64, 0, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(224, 0, 32, 48), 0.125f),
                new AnimationFrame(new Rectangle(128, 0, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(160, 0, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(256, 0, 32, 48), 0.125f)
            });


            animation.AddAnimation("idle-up", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(0, 48, 32, 48), 0f)
            });

            animation.AddAnimation("walk-up", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 48, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(64, 48, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(96, 48, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(128, 48, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(160, 48, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(192, 48, 32, 48), 0.135f)
            });

            animation.AddAnimation("run-up", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 48, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(64, 48, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(224, 48, 32, 48), 0.125f),
                new AnimationFrame(new Rectangle(128, 48, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(160, 48, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(256, 48, 32, 48), 0.125f)
            });


            animation.AddAnimation("idle-right", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(0, 96, 32, 48), 0f)
            });

            animation.AddAnimation("walk-right", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 96, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(64, 96, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(96, 96, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(128, 96, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(160, 96, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(192, 96, 32, 48), 0.135f)
            });

            animation.AddAnimation("run-right", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 96, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(64, 96, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(224, 96, 32, 48), 0.125f),
                new AnimationFrame(new Rectangle(128, 96, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(160, 96, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(256, 96, 32, 48), 0.125f)
            });


            animation.AddAnimation("idle-left", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(0, 144, 32, 48), 0f)
            });

            animation.AddAnimation("walk-left", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 144, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(64, 144, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(96, 144, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(128, 144, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(160, 144, 32, 48), 0.135f),
                new AnimationFrame(new Rectangle(192, 144, 32, 48), 0.135f)
            });

            animation.AddAnimation("run-left", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(32, 144, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(64, 144, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(224, 144, 32, 48), 0.125f),
                new AnimationFrame(new Rectangle(128, 144, 32, 48), 0.08f),
                new AnimationFrame(new Rectangle(160, 144, 32, 48), 0.055f),
                new AnimationFrame(new Rectangle(256, 144, 32, 48), 0.125f)
            });


            animation.SetDefaultAnimation("idle-down");
            animation.Play("idle-down");

            Components.Add(animation);
        }
示例#22
0
文件: DrawMap.cs 项目: CarimA/RPG
        public DrawMap(GameState gameState, IOverworld overworld, VirtualResolution virtualResolution, SpriteBatch spriteBatch, IRenderer renderer, IAssetLoader assetLoader, Camera camera, Primitive primitive, GameDate gameDate)
        {
            _random = new Random();

            _overworld         = overworld;
            _virtualResolution = virtualResolution;
            _spriteBatch       = spriteBatch;
            _renderer          = renderer;
            _assetLoader       = assetLoader;
            _camera            = camera;
            _primitive         = primitive;

            _tempTileMap  = _assetLoader.Get <Texture2D>("debug/outmap.png");
            _superTileset = _assetLoader.Get <Texture2D>("debug/supertileset.png");

            _tileMapFilter = new TilemapFilter(_renderer, _spriteBatch,
                                               _assetLoader.Get <Effect>("shaders/tilemap.fx"), 16);
            _tileMapFilter.SetSuperTileset(_superTileset);
            _tileMapFilter.SetTileMapTexture(_tempTileMap);

            _waterReflectionFilter = new WaterReflectionFilter(_renderer, _spriteBatch,
                                                               _assetLoader.Get <Effect>("shaders/water_reflection.fx"));

            _waterFilter = new WaterFilter(_renderer, _spriteBatch, _camera,
                                           _assetLoader.Get <Effect>("shaders/water.fx"),
                                           _assetLoader.Get <Texture2D>("ui/noise.png"),
                                           _assetLoader.Get <Texture2D>("ui/noise2.png"), _virtualResolution);

            _waterDisplacementFilter = new WaterDisplacementFilter(_renderer, _spriteBatch, _virtualResolution,
                                                                   _assetLoader.Get <Effect>("shaders/displace.fx"),
                                                                   _assetLoader.Get <Texture2D>("ui/displacement.png"),
                                                                   _assetLoader.Get <Texture2D>("ui/displacement2.png"));

            _dayNightFilter = new DayNightFilter(_renderer, _spriteBatch, gameDate,
                                                 _assetLoader.Get <Effect>("shaders/average.fx"),
                                                 _assetLoader.Get <Effect>("shaders/color.fx"),
                                                 new List <(float, Texture2D)>()
            {
                (0, assetLoader.Get <Texture2D>("luts/daycycle1.png")),
                (0.1875f, assetLoader.Get <Texture2D>("luts/daycycle1.png")),
                (0.208334f, assetLoader.Get <Texture2D>("luts/daycycle2.png")),
                (0.30208333f, assetLoader.Get <Texture2D>("luts/daycycle3.png")),
                (0.41667f, assetLoader.Get <Texture2D>("luts/daycycle4.png")),
                (0.46f, assetLoader.Get <Texture2D>("luts/daycycle5.png")),
                (0.54f, assetLoader.Get <Texture2D>("luts/daycycle5.png")),
                (0.58333f, assetLoader.Get <Texture2D>("luts/daycycle6.png")),
                (0.6875f, assetLoader.Get <Texture2D>("luts/daycycle7.png")),
                (0.7708333f, assetLoader.Get <Texture2D>("luts/daycycle8.png")),
                (0.82291667f, assetLoader.Get <Texture2D>("luts/daycycle9.png")),
                (0.90625f, assetLoader.Get <Texture2D>("luts/daycycle10.png"))
            });

            CreateRenderTargets();

            _windTrail = new GameObject();
            CAnimation windTrailAnimation;

            _windTrail.Components.Add(new CPosition(Vector2.Zero));
            _windTrail.Components.Add(new CSprite(assetLoader.Get <Texture2D>("ui/windtrail.png"), Vector2.Zero));
            _windTrail.Components.Add(windTrailAnimation = new CAnimation()
            {
                Loop = false, OnComplete = OnComplete
            });
            windTrailAnimation.AddAnimation("effect", new List <AnimationFrame>()
            {
                new AnimationFrame(new Rectangle(0, 0, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 64, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 128, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 192, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 256, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 320, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 384, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 448, 512, 54), 0.07f),
                new AnimationFrame(new Rectangle(0, 512, 512, 54), 0.07f),
            });
            _windTrail.Components.Add(new CFringeEntity {
                Opacity = 0.15f
            });

            gameState.Stage.GameObjects.Add(_windTrail);
        }
示例#23
0
 public void OnIconDied(CAnimation animation)
 {
     icon.SetState(EState.Death);
     observer.OnDieEnd();
 }
示例#24
0
    /*
     * Pause the animation for a few ticks.
     * @param animation The Animation to pause.
     * @param parameter How many ticks it should pause.
     * @note Delays are randomly delayed with [0. . .3] ticks.
     */
    static void Animation_Func_Pause(CAnimation animation, short parameter)
    {
        Debug.Assert(parameter >= 0);

        animation.tickNext = (uint)(g_timerGUI + parameter + (Tools_Random_256() % 4));
    }
示例#25
0
    /*
     * Set the IconGroup of the Animation.
     * @param animation The Animation to change.
     * @param parameter To what value IconGroup should change.
     */
    static void Animation_Func_SetIconGroup(CAnimation animation, short parameter)
    {
        Debug.Assert(parameter >= 0);

        animation.iconGroup = (byte)parameter;
    }
示例#26
0
 /*
  * Rewind the animation.
  * @param animation The Animation to rewind.
  * @param parameter Not used.
  */
 static void Animation_Func_Rewind(CAnimation animation) =>
 animation.current = 0;
示例#27
0
 // Use this for initialization
 void Start()
 {
     m_Game      = GameObject.Find("_Game").GetComponent <CGame>();
     m_Animation = new CAnimation(m_material, m_columns, m_rows, m_fFPS);
     m_Game.getLevel().CreateElement <CMachine>(gameObject);
 }
示例#28
0
 /*
  * Play a Voice on the tile of animation.
  * @param animation The Animation which gives the position the voice plays at.
  * @param parameter The VoiceID to play.
  */
 static void Animation_Func_PlayVoice(CAnimation animation, short parameter) =>
 Voice_PlayAtTile(parameter, animation.tile);
示例#29
0
 protected virtual void Awake()
 {
     _animation = GetComponent <CAnimation>();
 }
示例#30
0
 /*
  * Forward the current Animation with the given amount of steps.
  * @param animation The Animation to forward.
  * @param parameter With what value you want to forward the Animation.
  * @note Forwarding with 1 is just the next instruction, making this command a NOP.
  */
 static void Animation_Func_Forward(CAnimation animation, short parameter) =>
 animation.current += (byte)(parameter - 1);