C# is a multiparadigm, managed, garbage-collected, object-oriented programming language created by Microsoft in conjunction with the .NET platform.

learn more… | top users | synonyms

0
votes
0answers
6 views

How to reference UnityEditor in external DLL when using UnityVS, successfully?

So I'm trying to put my scripts and custom inspector editor scripts in two external DLLs and I'm facing a problem on my Editor DLL. First of, I'm using UnityVS with Visual Studio 2013 Ultimate. I ...
0
votes
1answer
47 views

Creating Entities from Identifiers (C#)

I am writing a game in C#/XNA. Often, it's useful to have a function like this in a game engine: Entity CreateEntity(string id, Vector3 location) { ... } So that, for instance, you ...
0
votes
1answer
16 views

Adding SpriteFont in Monogame

My question is probably something you guys have heard before - "How do you add SpriteFont's in Monogame's content manager?" The simple answer to this is, right click the 'Content' folder, go on 'Add ...
0
votes
0answers
18 views

OcclusionQuery for certain part of screen

As you see on the Image above, I want to know how can I calculate the number of pixels of players inside the elephant ? because OcclusionQuery is used for count number of pixel for whole screen but ...
-1
votes
0answers
11 views

System.AccessViolationException when instantiating a SlimDX.Direct3D9.VertexShader from pointer

I'm trying to instantiate a SlimDX.Direct3D9.VertexShader object from a pointer. I retrieve the pointer using the PassDescription object present in the compiled effect like so: try { // create ...
-3
votes
1answer
50 views

Direct raycasting from moving point A and moving Point B

I am attempting to raycast from Point A to Point A (both moving points). I dont understand the comcept of raycasting (direction). Update() { player = GameObject.FindGameObjectWithTag ("Player"); ...
1
vote
0answers
29 views

XNA Texture2D GetData [on hold]

this is my code for creating Texture2D from depthFrame of Kinect : private short[] depthData; private Texture2D depthTexture; Color[] depthTextureData; if (null == this.depthData || ...
0
votes
0answers
34 views

Setting up a turn-based combat [on hold]

I'm starting a little rpg in C# and ran into a bit of a problem with battling enemies. Battles functions as a series of turn-based interactions (rounds) between parties made of varying amounts of ...
0
votes
1answer
61 views

How can I raycast between two moving objects in Unity?

How can I raycast between two moving objects? I want to raycast from a moving enemy to a moving player. I dont know how to actually code to make the direction work. using UnityEngine; using ...
0
votes
2answers
55 views

XNA - Card Game - 3D vs 2D vs Primitives [on hold]

I'm starting a new project in XNA which will be a card game. What is the best way to implement my cards? Since I want to rotate these, they'd have to be somehow displayed 3D. The game itself will be ...
6
votes
2answers
124 views

How can I draw a line of certain length and direction?

I want to create a line of certain length and direction. What I mean by this is drawing a line from Point A to Point B. Normally in Unity C# to draw a line from Point A to Point B is simply: ...
-1
votes
0answers
33 views

Respawn destroyed object in Unity

I have this script where as to when i hit a trigger my enemy spawns at a random time then the enemy destroy itself at a random time. I want to respawn the enemy again so it can do this over and over ...
-1
votes
0answers
72 views

Unity alternative? [closed]

I have been trying Unity for the last few weeks, but I don't really like it. It is way to much constructing instead of coding yourself, and I think the coding is the best part. Do you have any ...
-2
votes
0answers
18 views

Open source c# based product with path finding and collision avoidance [closed]

I plan on researching the crowd simulation, but is there any free/cheap (semi-)open source product which already has path finding and collision avoidance functionality? which could be easily modified? ...
-5
votes
0answers
51 views

Airhockey AI C# Script [closed]

Hi Everyone i am making an airhockey game and need some help with the AI of the game
0
votes
1answer
34 views

Height and Width of Player Depth View using Kinect SDK

This code shows that how we can find the player from the depth Image: this.depthData = new short[frame.PixelDataLength]; frame.CopyPixelDataTo(this.depthData); for (int depthIndex = 0; ...
1
vote
0answers
19 views

NegaScout with Zobrist Transposition Tables in Chess

I'm trying to put Transposition tables into my alpha beta scout. I do see an incremental speed boost I think toward mid or late game, however, even with a table size of 1-2GB, its may or may not be ...
2
votes
1answer
52 views

How do I spawn an enemy at one of many spawn points in Unity?

I have a spawn script that so far only creates one Enemy spawn point and enemy trigger while only spawning one enemy. Instead, I want it to create multiple spawns and triggers, but keep it such that ...
0
votes
1answer
84 views

How to show my XNA game in form C#

I have a game in XNA, I want to connect this game with WindowForm to show for example the distance and the position. I tried to apply many tutorials that talking about this. but here is my problem : ...
0
votes
0answers
25 views

raise an event when an object appears using HLSL and XNA

I've written an HLSL code to make transparency of player using depth view of Kinect on the background image. this is my HLSL code : sampler stream : register(s0); sampler back : register(s1); sampler ...
-1
votes
1answer
37 views

Float increment give wrong result [closed]

I found something weird with my unity code : public class heroesscript : MonoBehaviour { float counter = 0; void FixedUpdate() { counter += 0.02f; print (counter); ...
1
vote
1answer
33 views

How to access an animation properties from the animator?

I'd like to change the property speed of an animation from the animator. For example, I'd like the player to be able to reload faster with upgrades. So I have a basic reload animation on the gun ...
0
votes
0answers
17 views

DrawBone Angle variable using Kinect

when we want to draw Bones into XNA (using KnectSDK and C#), you have to calculate differences between two joints and draw bones between them. this is the function for drawing Bones: private void ...
-1
votes
0answers
34 views

A program in OpenGl [closed]

I wrote a program in C++ OpenGl which to insert a special character to the display window display for entering characters ... for example by enter 'A' character the open windows shows A . but i don't ...
0
votes
0answers
37 views

Faction system in C# [closed]

In an RPG type game how would one go about handling a faction system? I was thinking about making a faction class that contains an int value that would determine how much it likes or dislikes another ...
2
votes
1answer
64 views

How can I make Network.RPC call a method with params object[]?

Why do I need to do this? The game I'm working on fully conforms to a component style design. Every component that a game object uses is placed on the object and is disabled/enabled based on it's ...
0
votes
1answer
49 views

Casting a directional line of which an object is coming from

I want to create a directional line ( curve / linear ) depending where the direction is coming from. In some games, similar to Angry Birds, a dotted guideline is shown to provide where the gameObject ...
1
vote
0answers
38 views

How to initialize once for all a static field of a custom editor in unity

I have a custom editor wich has a static field. Suppose you have a static field of type MyObject: public class myEditor : Editor { ... private static MyObject myObj; ... } I'd like to ...
0
votes
0answers
22 views

Unity3D C#: How to resize an inputfield according the content which is set dynamic

I've got an InputField where the text is filled in upon getting a string back from the server. We can debug the entire text so we receive it correctly. However the text is too long to fit in our ...
0
votes
0answers
29 views

Monogame: Unsupported Landscape Screen Orientation on iOS 8.0

Did anyone have a fix on the landscape orientation problem that monogame has or is it the iOS 8.0 that has a bug? I have visited the github of monogame and tried to compile the latest developer ...
0
votes
0answers
21 views

Creating a ray with angle movement restrictions

In Unity is it possible to create a ray which has movement restrictions. As in creating a ray which is fixed to one point. When this point is moved around. The line is also moved around. But when the ...
1
vote
3answers
149 views

Responsibility of rendering in a component/entity game engine

I am developing a simple component/entity game engine in C# (https://github.com/alexvm/BlueShift) and have a few questions regarding the responsibility of certain items in the engine itself. I have ...
0
votes
1answer
63 views

Best way to go about collision between rectangle and bool array containing pixel data?

Basically, if I have an array along the lines of bool[] collision; Filled with a value for each pixel in the sprite I am checking collision against (pixel 1 = true, pixel 2 = false etc), how do ...
0
votes
1answer
56 views

Find index of GameObject in array of GameObjects

In my script, i have declared an array of GameObjects like this: public GameObject[] go;ld object name. `String temp;` Also, i have a temporary variable to ho Then, i assigned objects to elements ...
3
votes
1answer
316 views

How can I separate component functionality from networking logic?

Is it possible to make network independent components that allow networking details to be specified externally? For example, if I have a "Follow" script that follows a game object, it would need to ...
1
vote
1answer
29 views

How to transform Unity terrain coordinates

My map creator created some terrain in Unity, but all my scripts are based on the X-Y axis. Is there an easy and smart way to transform them into Z-Y, or do I have to change all the vector variables ...
0
votes
1answer
53 views

How to get display resolution (screen size)?

How to get display resolution in XNA/Monogame ? I tried these on my monitor (1600x900): The below give me 800,600 //1. GraphicsDevice.DisplayMode.Width GraphicsDevice.DisplayMode.Height //2. ...
0
votes
0answers
47 views

Basic .FBX Animation for the Complete Novice [on hold]

okay, so in terms of 3D in XNA, I am pretty much a total beginner. I know all my matrices, basic lighting, transforms etc, but I'm finding 3D animation very confusing. I have been looking a bit at the ...
1
vote
2answers
58 views

Better way to position objects in a Matrix/Grid shape

I am working on space a invader game and I'm trying to build levels such that in each of them, the aliens are positioned in a different shape. I have a rectangle shape, circle shape, and a grid-like ...
0
votes
0answers
13 views

Unity StartApp Ad Sdk dims the screen down when showed

I'm making an android game Which Never Sleeps and it don't. But When Using Startapp ad sdk It seems that it pauses the game and the mobile sleeps when the ad is shown. As if the sdk handles it from ...
1
vote
1answer
137 views

Trouble With Quaternions and orbital camera:

UPDATED: I have been trying to implement a Orbital Camera of sorts in a engine I am currently doing in Unity3D, the issue being I can't seem to do the correct rotation no matter what. This is what it ...
2
votes
1answer
67 views

When two RPC methods have the same name, which is called?

I have a situation where I would want two of the same components( in a hierarchy ), to be on a GameObject. If this component has an RPC method, it obviously cannot change name per instance of the ...
0
votes
0answers
19 views

TouchCollection positon not matching button position

I am using a TouchCollection of touchlocations to determine if a button has been pressed, However the touchlocation position does not correspond with the button location as I would expect, the touch ...
-2
votes
1answer
48 views

Split up a string and add each as an item in an array [closed]

I have an input string and input the following "2, 4, 5, 7, 10" (for example). How can I split it as an object(item) for a list array? so it would be in each item "2", "4", "5", "7", "10"
3
votes
2answers
107 views

Bevel outline algorithm in 2D

I'm writing a program that creates animated blobs in 2D, to simulate cells. In order to beautify these objects, I'd like to give them a 3D look by adding a bevel-effect. How can this be achieved? ...
3
votes
1answer
69 views

Mock Collision Object in Unity

Problem: I'm trying to set up some tests with mock collision objects, but i cannot construct collisions with custom objects. What I'm trying to do: Collision2D col = new Collision2D(); ...
0
votes
1answer
59 views

Calculate polygon points from image

I'm new to OpenGL, so please excuse my brevity and/or lack of technical knowledge of the subject. I need some help with rendering a polygon on an OpenGL canvas (using C# w/ Tao). I understand that I ...
0
votes
0answers
81 views

C# Monogame & Farseer Physics: Collisions [closed]

I am a begginer. I am using Monogame and Farseer Physics Library in C#. (latest versions) In my game, whenever my ball (circle) hits the corner of a rectangle, (or even another circle), it is ...
3
votes
1answer
84 views

How to create laser redirection?

Think portal 2, where a laser can go through a cube, and depending on the rotation of that cube, it will redirect it. Examples: Here is my barely functioning code. It works for one cube, I'm able ...
0
votes
1answer
43 views

Draw my array at a position defined with Vector2

I'm developing a space invaders game in C# using XNA Game Studio. So I got some of the invader logic complete: An array holds the invaders and draws them on the screen, animated and moving.But I can't ...