Questions tagged [unity3d]
The unity3d tag has no summary.
23 questions
0votes
1answer
74views
API design with conditional compilation: stubs and exceptions vs public API change?
I am developing a package for the Unity game engine. I want to add additional functionality to my package if another specific package is present. I am faced with a dilemma I am not sure which of these ...
0votes
0answers
311views
Unity ScriptableObject vs Abstract class for Spells
I am trying to create a spell casting system for an auto chess game. I find myself not knowing which direction to go in my design. I started out with a Spell as a scriptable object that contains a ...
1vote
1answer
761views
State machine - how to handle outside environment values?
I've got a state machine implementation in Unity that I'm working on (C#), the plan being that it will be mostly used for AI related things. I'm not sure how I should deal with various "inputs&...
0votes
1answer
305views
Is it ok to Inject a whole object instead of only the dependencies
I'm working with the Dependency Injection Pattern in Unity3D (an engine which uses MonoBehavior, a class that doesn't have a constructor, as the base class for all of its game components), and I ended ...
1vote
2answers
282views
Avoiding duplicate code between the player and npc classes deriving from Unity's MonoBehaviour
These would be the base classes like Npc and NpcTask. public abstract class NpcTask { public Npc Npc { get; private set; } public NpcTask(Npc npc) { Npc = npc; } public ...
-3votes
1answer
52views
Do you recommend having a template scripts?
I am pretty much new to programming, but recently I began to learn C# intensively for Visual C# and for Unity. I have noticed that I use many scripts that have absolutely the same content in different ...
-2votes
1answer
86views
Are These Both The Same Or Different If Statements [duplicate]
This is for unity I tried another way of stopping player after he dies and it worked fine but now it does not work with sounds That was my way the only thing that I changed is the state Ben's was ...
4votes
3answers
528views
How to do grid systems with floats given precision causes problems
I've been trying to create a grid system that can use any grid size and start at any given anchor point rather than always at 0,0. The problem however is imprecision makes it impossible, even the ...
0votes
0answers
201views
Most performant way to store and find overlap in (coordinate, id, time interval) triples
Let me explain what I'm doing. I have a grid based on integer coordinates like (5,5), (5,6) etc., and I have an algorithm FindCells that generates a list of (coordinate, interval) tuples. These ...
0votes
0answers
2kviews
Inherit a class that inherits a generic class to make it easier to read
I'm creating a simple Dependency Injection library for Unity (no constructors available) and I want to use a generic class that implements a generic call for each class that would inherit it allowing ...
3votes
1answer
192views
Transforming a long-running operation into a step by step operation?
I am working on a video game in Unity and at some point I'm facing a tough problem to solve: The game freezes while loading level data. Let me lay down what's happening in that process that takes a ...
1vote
1answer
159views
Handling multiple game modes with a game controller
I have a basic GameController with a finite state machine to handle game logic. I'm adding game modes and coming across problems cleanly implementing them. The core functionality of the game stays ...
4votes
7answers
2kviews
Sync one thousand vector3 across network with minimal bytes?
I am making a game with Unity, and am having problems attempting network synchronisation. Deterministic simulation is impossible because Unity's internal logic is float based. I am trying to make a ...
4votes
1answer
348views
Between JS clients and a Unity game server : TCP or UDP?
I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http:/...
1vote
2answers
1kviews
Test a wrapper to external static/singleton
I am integrating an external library that declares a singleton, like this: public class External : MonoBehaviour { public static External Instance { get {/*setup inner stuff*/} } public void ...