New answers tagged

0

Please take a look at this; if I'm on the right track, I'll expand it and add narrative. You'll draw a single terrain prefab over and over, having it morph based on the descriptions fed in via the per-instance buffer. Example description elements: Matrix worldMatrix; UINT terrainTextureArrayIndex; Pickups can be handled similiarly. Draw a single cube ...


0

Design some level blocks with combination of obstacles coins etc. (Maintain a parent child relation). Make a LevelGeneator script which will contain a Array of Transform or Gameobject. Assign the level blocks to the Script object in inspector. Randomly take a Transform and give it some force and make SetActive(true). If its still not clear, let me ...


0

Yea, you can safely replace folders and keeping in mind about the Special Folders Name. Other than that you can play around with.


2

The typical approach one - and the one taken to an extreme end by the "ECS" pattern that's hyped these days - is to have your module itself manage the components. That is, UIModule shouldn't have to iterate through the scene to find all UIComponent instances. Instead, the module should just have a list of the components it cares about. It can easily then ...


20

A common approach is to have a component-based approach where the base-class "Unit" just implements the most basic aspects all units have in common, while each unit then has a list of multiple component-objects which say what it can do and how it does it. For example, a tank might have the components Mobile, Destructible, Attacker, an immobile turret only ...


4

A lot of games use a component-based system for entities which is where a bunch of behaviours and abilities can be added to a more generic unit type rather than being coded as part of the entity's class (or equivalent).


0

A common approach is to have a central "Settings" object which is implemented as a class which follows the Singleton pattern. When another class needs to look up the value of a setting, they obtain the instance of the Settings class and look it up. The Settings class should also include the necessary code to persist and retrieve the settings. Any values ...



Top 50 recent answers are included