Marius Chiriac
    • Posts
    • Client Server
      • Cookies in development
      • Node: Migrate JS to TS
      • Stripe payment React-Flask
      • Paypal payment React-Flask
    • React
      • React: Migrate JS to TS
    • Unity
      • Design Patterns
        • Chain of Responsibility
        • Command
        • Object Pool
        • Component
      • javascript in WEBGL build
      • Timeline
        • Change timeline dinamically
        • Concatenate Timeline
        • Unity Timeline
    Concatenate Timeline

    Someway you will need split one timeline into multiple in order to execute different timeline variants with less assets on the bag. Coroutine that plays 2 timeline at correct time playableDirector.playableAsset = info.timeline[0]; PrepareTimeline(); playableDirector.Play(); yield return new WaitForSeconds((float)playableDirector.playableAsset.duration * Time.timeScale); playableDirector.playableAsset = info.timeline[1]; PrepareTimeline(); playableDirector.Play(); playableDirector is the reference to the PlayableDirector unity component. PrepareTimeline() is a method that fill the timeline’s clips with the instanced gameobjects. playableDirector.

    June 9, 2021 Read
    Unity Timeline

    Timeline is a powerfull unity tool that permit to create a temporal sequence of instructions. Create Timeline Asset In Project right click and select Create>Timeline That operation create a *.playable file that represent a timeline asset. Timeline Tracks Here is the official doc about tracks On the left side of a Timeline we can see which tracks are used. A Track is a type of clips and is shown in horizontal.

    June 9, 2021 Read
    Chain of Responsibility Pattern

    Behavioural Design Pattern applied on unity Pattern explenation Intent Avoid coupling between the sender of a request and the recipient, allowing more than a single object to hear the request. Concatenate the recipient objects and pass the request of object in object until one of these fails to fulfill it. Applications more than one object can handle a request and the receiver who will handle it is not known a priori.

    December 6, 2020 Read
    Change timeline dinamically

    To achieve this result, we need a controller that hold the PlayableDirector and fill the current/correct value to the interested Timeline before to play it. We will use custom PlayableAsset and PlayableBehaviour to add new behaviour into the Timeline Create Custom Timeline Track Create the TrackAsset to create your custom line track in the timeline, so you will be able to right-click the left side timeline’s panel to see the action “MovementTrack” or what else you named your TrackAsset.

    December 3, 2020 Read
    Commmand Pattern

    Behavioural Pattern. Pattern explenation Intent Encapsulate a request as an object, thereby letting you parametrize clients with different requests, queue or log requests, and support undoable operations. What it solve Need to issue requests to objects without knowing anything about the operation being requested or the receiver of the request. Applications To parameterize objects with respect to an action to be performed To specify, queue and execute requests at different times To allow the cancellation of operations To organize a system into high-level operations which are themselves based on primitive operations Actors Command Specifies an interface for performing a generic operation ConcreteCommand Defines a link between a target object and an action Implement the Execute method by invoking the corresponding method (s) on the Receiver Keeps the data of the action Client Create a concrete instance of Command and set its Receiver Invoker Asks Command to complete the request Keeps the history of ConcreteCommand used Receiver Knows the way to perform the operations associated with a request.

    December 3, 2020 Read
    Component Pattern

    Game Programming Pattern. Pattern explenation Intent Allow a single entity to span multiple domains without coupling the domains to each other What it solve The creation of big classes that are hard to mantain. Applications You have a class that touches multiple domains which you want to keep decoupled from each other. A class is getting massive and hard to work with You want to be able to define a variety of objects that share different capabilities, but using inheritance doesn’t let you pick the parts you want to reuse precisely enough.

    December 3, 2020 Read
    Object Pool Pattern

    Behavioural Pattern. Pattern explenation Intent Improve performance and memory use by reusing objects from a fixed pool instead of allocating and freeing them individually. What it solve Management of list of the same object type Applications To frequently create and destroy objects. Objects are similar in size. Allocating objects on the heap is slow or could lead to memory fragmentation. Each object encapsulates a resource such as a database or network connection that is expensive to acquire and could be reused.

    December 3, 2020 Read
    Integration of javascript in Unity WEBGL build

    In this guide we will see how to integrate javascript functions in unity game with WEBGL build Workflow from unity script call a plugin that comunicate to the script where the build is placed the plugin function have only the work to call a javascript function of site environment change the javascript function without rebuilding everytime Create the plugin plugin.jslib var plugin = { CallFunction: function() { CustomFunction(); } }; mergeInto(LibraryManager.

    November 29, 2020 Read
    Navigation
    • About
    • Skills
    • Experiences
    • Recent Posts
    • Projects
    Contact me:
    • Email: redarked@gmail.com
    • Phone: +39 3880947809

    Toha
    © 2021 Marius Chiriac.
    Powered by Hugo Logo