Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - gary-unikronsoftware

Pages: [1] 2 3 4
1
Support / Re: Help with Lives System
« on: September 21, 2013, 04:25:26 pm »
It's probaby easier to use the tk2dTextMesh to display the score.  In the hierarchy create a tk2dUITextMesh object then drag it to the livesMesh slot on the script.  Depending on your camera settings you may have to change the scale of the text mesh so it is visible.

Code: [Select]
using UnityEngine;
using System.Collections;

public class Lives : MonoBehaviour
{
public int startingLives = 3;
    public static int curLives;
public tk2dTextMesh livesMesh;

   void Start ()
{
curLives = startingLives;
livesMesh.text = "Lives: " + curLives.ToString();
livesMesh.Commit();
   }
   
void OnLevelWasLoaded(int level)
{
if (level == 08)
{
if (Score.score < 1500)
{
  curLives--;
livesMesh.text = "Lives: " + curLives.ToString();
livesMesh.Commit();
}
            if (curLives < 0)
{
  print ("Game Over!");
                livesMesh.text = "Game Over!" + curLives.ToString();
livesMesh.Commit ();
            }
}
}
}

2
Support / Re: Help with Lives System
« on: September 20, 2013, 09:53:55 am »
So are you saying that the "Lives: " and "Game Over" text isn't displaying? Or do you want your character sprite to change when they have no lives left?

3
Support / Re: Collision Between Two Sprites
« on: September 20, 2013, 09:08:12 am »
Glad to hear you got it working :-)

4
Support / Re: Collision Between Two Sprites
« on: September 19, 2013, 11:22:20 pm »
The only other thing I can think of is that you haven't got a rigid body on the sprite you have your script attached to.  Failing that, if you create a cut down scene and export it and email it to support at unikronsoftware.com we'll have a look at it for you.

5
Support / Re: Collision Between Two Sprites
« on: September 19, 2013, 10:40:03 pm »
In addition to setting the mesh collider to convex, also make sure that the depth of the collider is sufficient which you can change in the sprite collection settings section - you can check the depth of them by viewing the sprite in the scene window.  Also, one of the sprites involved in the collision should have the 'Is Trigger' setting checked in the Mesh Collider component.

6
Yeah, the last post in the link to the other thread tells you what you need to do, its a pretty simple change but let us know if you have any problems.

7
Support / Re: Help with Lives System
« on: September 19, 2013, 09:28:13 am »
Hi,

You don't say exactly what your problem is you're having, but the first thing I noticed in your script is that you you have your 'game over' code in an else-if block;  so if the player scores less than 1500 points you remove a life from him, but the game over check wouldn't get done as the code has already done the 'if' part.  Just make the curLives check a separate if statement. 

As for the time limit, just make a note of the time when the level starts, the time when the level ends, calculate the total time taken from that and if the time exceeds your chosen limit also remove a life.

8
Hi,

Yes this was a bug in a previous version of toolkit (http://unikronsoftware.com/2dtoolkit/forum/index.php/topic,2356.msg11790.html#msg11790), good news is that I have just tested it in toolkit 2.2 final and it's been fixed now.

9
Support / Re: Can you have clipping on a slided sprite?
« on: September 17, 2013, 09:26:48 am »
Hi,

The toolkit comes with a ProgressBar prefab which sounds like what you're looking for.  You can find it in tk2dUI_demo > ControlPrefabs folder and you can choose which sprites it uses.

10
Support / Re: Problem in the Mole in the Whack-a-Mole tutorial
« on: September 16, 2013, 02:41:50 pm »
Glad you have got it working.

11
Support / Re: Problem in the Mole in the Whack-a-Mole tutorial
« on: September 16, 2013, 01:11:26 pm »
Hi,

Just to check a few things...

Is it just the mole you're not seeing?  Can you see the hole and the dirt okay?
If you double click on the mole object in the hierarchy window, can you see the mole in the scene view?
Does the mole not appear in the Game view at all, or only when you press the play button?

My first thought would be that maybe the mole isn't positioned correctly on the z-axis - remember the higher the z position value the farther it will be from the camera so it could be the case the mole is behind some of the background objects.  Alternatively, if the z position value is too small, the object could be behind the camera so won't be picked up by it.

At the end of the Game Objects tutorial page, you can download an example package of what your project should be like at that stage, so you can compare your project with ours to see if there's any differences.  Or you can package your project up and send it to support at unikronsoftware.com which will make it easier for us to troubleshoot.

12
Support / Re: tk2dUIScrollableArea OnClickUIItem questions
« on: September 16, 2013, 10:20:48 am »
Hi,

Basically for child UIItems you need the 'Child of Another UIItem' box checked.  Check out the '5 - ScrollableArea' example in the TK2DROOT > tk2dUI_demo  folder to see this in action.

13
Support / Re: Null reference exception in tk2dtextmesh.commit()
« on: September 16, 2013, 09:15:16 am »
You can send your package to support at unikronsoftware.com

14
Support / Re: NullReferenceException when using tk2dTextMesh
« on: September 13, 2013, 10:08:05 am »
And if you comment out all of the code in the PlayerObject Update function (everything referring to the text mesh) do you get the same error?  Usually the 'Object reference not set to an instance of an object' error is when you're trying to use a variable that has not been set.  I set up a simple test case using your PlayerObject code and the 'textMesh != null' line stops the rest of the code executing if no textMesh is attached to the game object (i.e. it worked correctly for me).

Probably the best thing for me to troubleshoot is if you create a scene with the bare minimum objects and code necessary to replicate the problem, export it and send it to support at unikronsoftware.com

thanks

15
Support / Re: NullReferenceException when using tk2dTextMesh
« on: September 13, 2013, 08:54:12 am »
Hi,

Does the Character object you are using for instantiating have a tk2dTextMesh component on it?

Pages: [1] 2 3 4