Tinglee Studios
  • Home
  • Projects

Singleton Prefabs for Unity3D

13/8/2017

0 Comments

 
Picture
We all know about the benefits of using Singletons in our games - you just call YourClass.Instance, and wala! A new GameObject gets created with the class attached immediately at run-time if its not already there. Magic! The common Singleton class for Unity3d can be found at the Unity3d wiki page.

While the Singleton design pattern for scripting has been a revelation, what about the same concept applied prefabs with exposed values or predefined configurations? They will be in the likes of Game Manager, Player Controller, SFX/BGM manager, Message Boxes, and many more.

Picture
For my own projects, I have implemented a modified version of the Singleton class from the Unity wiki page, and it's been super convenient for me since. So I'm gonna share the code with you and I hope it helps you too! Do leave some feedback if you found it helpful, or thought of a better implementation, or if you've faced other challenges using this method.

I'm pasting the code below and also uploaded it to 
Github, so feel free to check it out!
SingletonPrefab.cs

    
0 Comments

NEW! Waypoints for 2D Pathfinding v1.1 (Unity3D)

14/8/2015

0 Comments

 
Picture
Setting up a network of waypoints using the A* algorithm has never been easier! One click is all you need create, link and delete waypoints. Once they are linked up, you’re pretty much ready to go!
Unity Store

features

  • Pathfinding on 2D plane  
  • One-click to add a new linked waypoint  
  • One-click to link up selected waypoints  
  • One-click to insert a waypoint between two selected waypoints  
  • One-click to unlink a waypoint (two ways)  
  • Show/Hide waypoint connections in scene view  
  • Customize gizmos color and size  
  • Adjustable agent movement speed 

new in v1.1
  • Performance enhancements 
  • Streamlined scripts 
  • Simplified waypoint setup via Menu 
  • Callback events 
  • Delete multiple selected waypoints 
  • Bug fixes 

tutorial

To help you better understand how to use the tool, I've created a series of videos to guide you through the process. Hope you find it useful!
  1. Foreword
  2. Importing the package
  3. Setting up the map
  4. Adding the first waypoint
  5. Adding neighbour waypoints
  6. Linking waypoints
  7. Inserting waypoints
  8. Deleting waypoints
  9. Setting up the agent
  10. Other settings
  11. End
0 Comments

Waypoints for 2D Pathfinding 1.0 (Unity 3D)

2/10/2013

0 Comments

 
Picture
Setting up a network of waypoints using the A* algorithm has never been easier! Three buttons are all you need setup new, link existing, and insert in-between waypoints. Once they are linked up, you’re pretty much ready to go!

Read More
0 Comments

Artificial Intelligence – Agent Evasion Demo (Unity3D)

10/7/2013

0 Comments

 
Picture
Here’s another simple Artificial Intelligence programming project I did in Unity3D for Agent Evasion. The Agent positions were randomized at the start of the code execution. The red Agents will keep moving forward until they collide with something. This is when they will rotate by a random angle and continue to move forward till the next collision.

Hope you guys enjoy the video!

0 Comments

Artificial Intelligence – Agent Formation Demo (Unity3D)

29/6/2013

0 Comments

 
Picture
This is a little Artificial Intelligence programming project I did in Unity3D for Agent Formation. The formation positions were preset before running the codes. When the red “leader” moves, the blue agents will rotate towards the nearest formation position before moving to place. If the position is being taken by another agent, this agent will then look for the next nearest available formation position and move towards it.

Hope you guys enjoy the video!

0 Comments

    Categories

    All
    Github
    Personal
    Prefabs
    Scripting
    Singleton
    Tools
    Unity3D
    Unity3D Assets

    RSS Feed


    Geeky Sites

    quora.com
    ​
    lynda.com
    leetcode.com
    ​geeksforgeeks.org
    sdtimes.com

About Me

Trained in materials engineering, had some fun in the graphic design industry, and learnt A LOT during my 4 yrs in data operations. I've been from startups to MNCs, all with the hopes of having a stable career. At the end, I chose to follow my heart, and I've never regretted a day since 2013.

  • Based In Singapore
    Leading a small team, developing some cool VR sh*t for the building and interior design industry.

  • Areas Worked On
    Tools  |  UI  |  Animation Controllers  |  VR  |  AR  |  AI Pathfinding  |  Others (a little bit of everything else)


  • Professional Skills
    Unity3D  |  C#  |  GIT  |  Project Management

    Contact Me

Submit

​Copyright 2017 Tinglee Studios