Showing posts with label unity. Show all posts
Showing posts with label unity. Show all posts
16 Nov 2017
13 Oct 2017
Singleton : Implementation in Unity3d C#
Objective :
Singleton is a very complex topic, In this, we try to understand basics and various implementation of Singleton in Unity3d using C#.Intro:
Singleton is a basic Design Pattern. Classes implementing Singleton pattern will ensure that only one instance of the object ever exists at any one time. It is recommend using Singletons for things that do not need to be copied multiple times during a game.This is great for controller classes like GameManager or AudioController.28 Sept 2017
23 Sept 2015
26 Jun 2015
Bounding Player to Screen
http://www.raywenderlich.com/70344/unity-2d-tutorial-physics-and-screen-sizes
http://www.aeonphyxius.com/2013/03/how-to-force-an-object-to-stay-in-the-visible-camera-area-in-unity/
My code:
/// <summary>
/// Restrict the player to the camera's boundaries
/// </summary>
private void LimitPlayerToCamera ()
{
_playerPos.x = Mathf.Clamp ( transform.position.x ,
CameraBehaviour.instance.transform.position.x - _widthOrtho + _playerBoundSize.x ,
CameraBehaviour.instance.transform.position.x + _widthOrtho - _playerBoundSize.x );
_playerPos.y = Mathf.Clamp ( transform.position.y ,
CameraBehaviour.instance.transform.position.y - Camera.main.orthographicSize + _playerBoundSize.y ,
CameraBehaviour.instance.transform.position.y + Camera.main.orthographicSize - _playerBoundSize.y );
transform.position = _playerPos;
}
http://www.aeonphyxius.com/2013/03/how-to-force-an-object-to-stay-in-the-visible-camera-area-in-unity/
My code:
/// <summary>
/// Restrict the player to the camera's boundaries
/// </summary>
private void LimitPlayerToCamera ()
{
_playerPos.x = Mathf.Clamp ( transform.position.x ,
CameraBehaviour.instance.transform.position.x - _widthOrtho + _playerBoundSize.x ,
CameraBehaviour.instance.transform.position.x + _widthOrtho - _playerBoundSize.x );
_playerPos.y = Mathf.Clamp ( transform.position.y ,
CameraBehaviour.instance.transform.position.y - Camera.main.orthographicSize + _playerBoundSize.y ,
CameraBehaviour.instance.transform.position.y + Camera.main.orthographicSize - _playerBoundSize.y );
transform.position = _playerPos;
}
13 May 2015
Object Pooling in Unity C#
Below are the links/tutorials on how to do object pooling in Unity.
http://answers.unity3d.com/questions/765574/can-someone-just-post-a-generic-object-pool-script.html
http://stackoverflow.com/questions/24442389/trouble-getting-a-game-object-from-object-pool-in-unity
http://blogs.msdn.com/b/dave_crooks_dev_blog/archive/2014/07/21/object-pooling-for-unity3d.aspx
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling
http://answers.unity3d.com/questions/765574/can-someone-just-post-a-generic-object-pool-script.html
http://stackoverflow.com/questions/24442389/trouble-getting-a-game-object-from-object-pool-in-unity
http://blogs.msdn.com/b/dave_crooks_dev_blog/archive/2014/07/21/object-pooling-for-unity3d.aspx
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling
17 Mar 2015
Unity Melee System
http://answers.unity3d.com/questions/249579/melee-attacking-multiple-enemies.html
http://gamedev.stackexchange.com/questions/69344/how-can-i-implement-a-directional-melee-attack
http://answers.unity3d.com/questions/182449/enemies-in-my-range.html
http://answers.unity3d.com/questions/14207/how-to-apply-explosionmagicgrenade-damage-to-detec.html
http://gamedev.stackexchange.com/questions/69344/how-can-i-implement-a-directional-melee-attack
http://answers.unity3d.com/questions/182449/enemies-in-my-range.html
http://answers.unity3d.com/questions/14207/how-to-apply-explosionmagicgrenade-damage-to-detec.html
3 Mar 2015
Subscribe to:
Posts (Atom)