Mar 2, 2021

Visual Studio Keyboard Shortcuts

Playing with keyboard shortcuts is very interesting and reduce the headache of using the mouse again and again while programming with visual studio IDE. Actually, keyboard shortcuts also enhance your productivity and make your programming life easy and convenient. So, I decided to share a list of top 10 visual studio keyboard shortcuts that's are amazing and very helpful. For more shortcuts refer the article Visual Studio Useful Keyboard Shortcut Keys.

  1. F5 & Ctrl-F5

    F5 is used to start your project in debug mode and Ctrl-F5 is used to start your project without debug mode.

  2. F7 & Shift-F7

    F7 is used to show code view of your webpage.

    Shift-F7 is used to show design view of your webpage.

  3. F6 / Shift-F6 / Ctrl-Shift-B

    All of the above shortcuts are used to build the project or solutions.

  4. Ctrl-Shift-A & Alt-Shift-A

    Ctrl-Shift-A is used to add new item to your project.

    Alt-Shift-A is used to add existing item to your project.

  5. Ctrl-K + Ctrl-C & Ctrl-K + Ctrl-U

    Ctrl-K + Ctrl-C is used to do comment a selected block of code.

    Ctrl-K + Ctrl-U is used to do uncomment a selected block of code.

  6. Ctrl-M + Ctrl-O & Ctrl-M + Ctrl-P

    Ctrl-M + Ctrl-O is used to collapse all code to definitions.

    Ctrl-M + Ctrl-P is used to expand all code.

  7. Ctrl-K + Ctrl-S & Alt-Shift-Arrow(Right,Left,Bottom,Top)

    Ctrl-K + Ctrl-S is used to surrounded a block of code to an specific block or control.

    Alt-Shift-Arrow(Right,Left,Bottom,Top) are used to copy, paste, write vertically as shown in fig.

  8. Ctrl-(+) + Ctrl-. & F12

    Ctrl-(+) + Ctrl-. is used to display smarttag under the red line that provides the options for fixing the code problem.

    F12 is used to navigate to the definition of an instance, variable, class etc.

  9. Ctrl-Shift-F, Ctrl-F & Ctrl-H

    Ctrl-Shift-F is used to find all the ocuurance of a string with in entire solution and display find result window as shown below.

    Ctrl-F is used to find a string in the current document, project and all open documents one by one. Ctrl-H is used to replace a string by a new string in current document, project and entire solution as you want to replace.

  10. F4 & Ctrl-Alt-L

    F4 is used to show property window.

    Ctrl-Alt-L is used to show solution explorer.


For more Information: 
https://www.dotnettricks.com/learn/visualstudio/top-10-visual-studio-keyboard-shorcuts

Sep 30, 2019

Best Hexagonal Grids Algorithm

This guide will cover various ways to make hexagonal grids, the relationships between different approaches, and common formulas and algorithms. Hexagonal grids aren't as common as square grids. I've been collecting hex grid resources for over 20 years, and wrote this guide to the most elegant approaches that lead to the simplest code, largely based on the guides by Charles Fu and Clark Verbrugge.

The code samples on this page are written in pseudo-code; they're meant to be easy to read and understand. The implementation guide has code in C++, Javascript, C#, Python, Java, Typescript, and more.

Continue in Reference https://www.redblobgames.com/grids/hexagons/

Also for unity, A hexagonal grid implementation based on amit's https://catlikecoding.com/unity/tutorials/hex-map/part-15/

Mar 21, 2018

Where is Unity Log Files?

Log Files

There might be times during development when you need to obtain information from the logs of the standalone player you’ve built, the target device, or the Editor. Usually you need to see these files when you have experienced a problem, to find out exactly where the problem occurred.
On macOS, the player and Editor logs can be accessed uniformly through the standard Console.app utility.
On Windows, the Editor logs are placed in folders which are not shown in the Windows Explorer by default. See below.

Editor

To view the Editor log, select Open Editor Log in Unity’s Console window.









On macOS, all the logs can be accessed uniformly through the standard Console.app utility.
On Windows, the Editor log file is stored in the local application data folder \Unity\Editor\Editor.log, where is defined by CSIDL_LOCAL_APPDATA.

Player


Note that on Windows and Linux standalones, the location of the log file can be changed (or logging suppressed). See documenttion on Command line arguments for further details.

iOS

Access the device log in XCode via the GDB console or the Organizer Console. The latter is useful for getting crashlogs when your application was not running through the XCode debugger.
The Troubleshooting and Reporting crash bugs guides may be useful for you.

Android

Access the device log using the logcat console. Use the adb application found in Android SDK/platform-tools directory with a trailing logcat parameter:

$ adb logcat

Another way to inspect the LogCat is to use the Dalvik Debug Monitor Server (DDMS). DDMS can be started either from Eclipse or from inside the Android SDK/tools. DDMS also provides a number of other debug related tools.

Universal Windows Platform

 


WebGL

On WebGL, log output is written to the browser’s JavaScript console.

Accessing log files on Windows

On Windows, the log files are stored in locations that are hidden by default. In Windows XP, make hidden folders visible in Windows Explorer using Tools > Folder Options… > View (tab).
On Windows Vista/7, make the AppData folder visible in Windows Explorer using Tools > Folder Options… > View (tab). The Tools menu is hidden by default; press the Alt key once to display it.

Reference:  https://docs.unity3d.com/Manual/LogFiles.html

How to Save and Load a Game in Unity

Games are getting longer and longer, with some having over 100 hours of content. It would be impossible to expect players be able to complete all of what a game has to offer in just one sitting. That’s why letting the player save their game is one of the most essential features your game should have — even if it’s just to keep track of their high scores.
But how does one create a save file and what should be in it? Do you need to use a save file to keep track of player settings too? What about submitting saves to the web so they can be downloaded later on a different device?
In this tutorial you will learn:
  • What serialization and deserialization are.
  • What PlayerPrefs is and how to use it to save player settings.
  • How to create a save game file and save it to disk.
  • How to load a save game file.
  • What JSON is and how you would use it.
It is assumed that you have some basic working knowledge of how Unity works (such as being able to create and open scripts), but other than that everything has been prepared so this tutorial will be very easy to follow. Even if you are new to C#, you should have no trouble keeping up except for a few concepts that might require further reading.
Note: If you are new to Unity or looking to pick up more Unity skills, you should checkout out our other Unity tutorials where you can learn about lots of Unity topics from C# to how the UI works.

Getting Started

Download the starter project here. You will be implementing the code for saving and loading the game, as well as the logic for saving the players settings.

Important Save Concepts

There are four key concepts to saving in Unity:
PlayerPrefs: This is a special caching system to keep track of simple settings for the player between game sessions. Many new programmers make the mistake of thinking they can use this as a save game system as well, but it is bad practice to do so. This should only be used for keeping track of simple things like graphics, sound settings, login info, or other basic user-related data.
Serialization: This is the magic that makes Unity work. Serialization is the conversion of an object into a stream of bytes. That might seem vague but take a quick look at this graphic:
Serialization illustration
What is an “object”? In this case an “object” is any script or file in Unity. In fact, whenever you create a MonoBehaviour script, Unity uses serialization & deserialization to convert that file down to C++ code and then back to the C# code that you see in the inspector window. If you’ve ever added [SerializeField] to get something to appear in the inspector, you now have an idea of what’s going on.
Note: If you’re a Java or web developer, you might be familiar with a concept known as marshalling. Serialization and marshalling are loosely synonymous, but in case you’re wondering what a strict difference would be, serialization is about converting an object from one form to another (e.g. an object into bytes), whereas marshalling is about getting parameters from one place to another.
Deserialization: This is exactly what it sounds like. It’s the opposite of serialization, namely the conversion of a stream of bytes into an object.
JSON: This stands for JavaScript Object Notation, which is a convenient format for sending and receiving data that is language agnostic. For example, you might have a web server running in Java or PHP. You couldn’t just send a C# object over, but you could send a JSON representation of that object and let the server recreate a localized version of it there. You’ll learn more about this format in the last section but for now just know that this simply a way of formatting data to make it multi-platform readable (like XML). When dealing with converting to and from JSON, the terms are JSON serialization and JSON deserialization respectively.

Player Prefs

This project has been set up so that all you will focus on is the logic for saving and loading games. However, if you are curious how it all works, don’t be afraid to open all the scripts and see whats going on, and feel free to ask a question here or in the forums if you need help.
Open the project, then open the Scene named Game and then click play.
Start menu
To start a game, click the New Game button. To play the game, you simply move your mouse, and the gun will follow your movement. Click the left mouse button to fire a bullet and hit the targets (which flip up and down at various time intervals) to get points. Try it out and see how high a score you can get in 30 seconds. To bring up the menu at any time, press the escape key.
game in progress
As fun as that game was, it might have been a little dry without music. You may have noticed that there is a music toggle, but it was switched off. Click play to start a new game, but this time click the Music toggle so it’s set to “On”, and you will hear music when you start your game. Make sure your speakers are on!
music toggle
Changing the music setting was simple, but click the play button again and you’ll notice a problem: the music is no longer checked. While you did change the music setting earlier, there was nothing keeping track of that change. This is the kind of thing that PlayerPrefs excels at.
Create a new script named PlayerSettings in the Scripts folder. Since you’ll be using some UI elements, add the following line at the top of the file with the other namespaces:
using UnityEngine.UI;
Next, add the following variables:
[SerializeField]
private Toggle toggle;
[SerializeField]
private AudioSource myAudio;
These will keep track of the Toggle and AudioSource objects.
Next add the following function:
  public void Awake ()
  {
    // 1
    if (!PlayerPrefs.HasKey("music"))
    {
      PlayerPrefs.SetInt("music", 1);
      toggle.isOn = true;
      myAudio.enabled = true;
      PlayerPrefs.Save ();
    }
    // 2
    else
    {
      if (PlayerPrefs.GetInt ("music") == 0)
      {
        myAudio.enabled = false;
        toggle.isOn = false;
      }
      else
      {
        myAudio.enabled = true;
        toggle.isOn = true;
      }
    }
  }
When set up, this will:
  1. Check if the PlayerPrefs has a cached setting for the “music” key. If there is no value there, it creates a key-value pair for the music key with a value of 1. It also sets the toggle to on and enables the AudioSource. This will be run the first time the player runs the game. The value of 1 is used because you cannot store a Boolean (but you can use 0 as false and 1 as true).
  2. This checks the “music” key saved in the PlayerPrefs. If the value is set to 1, the player had music on, so it enables the music and sets the toggle to on. Otherwise, it sets the music to off and disables the toggle.
Now Save the changes to your script and return to Unity.
Add the PlayerSettings script to the Game GameObject. Then expand the UI GameObject, followed by the Menu GameObject to reveal its children. Then drag the Music GameObject on to the Toggle field of the PlayerSettings script. Next, select the Game GameObject and drag the AudioSource over to the MyAudio field.
<Connect PlayerSettings script
The music is set up to work when the game runs (since there is code in the Awake function), but you still need to add the code if the player changes the setting during gameplay. Open the PlayerSettings script and add the following function:
  public void ToggleMusic()
  {
    if (toggle.isOn)
    {
      PlayerPrefs.SetInt ("music", 1);
      myAudio.enabled = true;
    }
    else
    {
      PlayerPrefs.SetInt ("music", 0);
      myAudio.enabled = false;
    }
    PlayerPrefs.Save ();
  }
This does almost the same as the code you wrote earlier, except it has one important difference. It checks the state of the music toggle and then updates the saved setting accordingly. In order for this method to be called, and thus for it to be able to do its work, you need to set the callback method on the Toggle GameObject. Select the Music GameObject and drag the Game GameObject over the object field in the OnValueChanged section:
Connecting the callback method
Select the dropdown which currently says No Function, and select PlayerSettings -> ToggleMusic(). When the toggle button in the menu is pressed, it will call the ToggleMusic function.
Selecting the right method
Now you’ve got things set up to keep track of the music setting. Click Play and try it out by setting the music toggle to on or off, then ending the play session and starting a new play session.
The game menu
The music setting is now properly saved! Great job — but you’re only getting started with the power of serialization.

Saving The Game

Using PlayerPrefs was pretty simple wasn’t it? With it, you will be able to easily store other settings in there such as the player’s graphic settings, or login info (perhaps Facebook or Twitter tokens), and whatever other configuration settings make sense to keep track of for the player. However, PlayerPrefs is not designed to keep track of game saves. For that, you will want to use serialization.
The first step to creating a save game file is creating the save file class. Create a script named Save and remove the MonoBehaviour inheritance. Remove the default Start() and Update() methods as well.
Next, add the following variables:
public List<int> livingTargetPositions = new List<int>();
public List<int> livingTargetsTypes = new List<int>();

public int hits = 0;
public int shots = 0;
In order to save the game you will need to keep track of where existing robots are and what types they are. The two lists accomplish this. For the number of hits and shots you are just going to store those as ints.
There is one more very important bit of code you need to add. Above the class declaration, add the following line:
[System.Serializable]
This is known as an attribute and it is metadata for your code. This tells Unity that this class can be serialized, which means you can turn it into a stream of bytes and save it to a file on disk.
Note: Attributes have a wide range of uses and let you attach data to a class, method, or variable (this data is known as metadata). You can even define your own attributes to use in your code. Serialization makes use of the [SerializeField] and [System.Serializable] attributes so that it knows what to write when serializing the object. Other uses for attributes include settings for unit tests and dependency injection, which are way beyond the scope of this tutorial but well worth investigating.
The entire Save script should look like this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Save
{
  public List<int> livingTargetPositions = new List<int>();
  public List<int> livingTargetsTypes = new List<int>();

  public int hits = 0;
  public int shots = 0;
}
Next, open the Game script and add the following method:
private Save CreateSaveGameObject()
{
  Save save = new Save();
  int i = 0;
  foreach (GameObject targetGameObject in targets)
  {
    Target target = targetGameObject.GetComponent();
    if (target.activeRobot != null)
    {
      save.livingTargetPositions.Add(target.position);
      save.livingTargetsTypes.Add((int)target.activeRobot.GetComponent().type);
      i++;
    }
  }

  save.hits = hits;
  save.shots = shots;

  return save;
}
This code creates an instance of the Save class you made earlier and then sets the values from the existing robots. It also saves the players shots and hits.
The Save button has been hooked up to the SaveGame method in the Game script, but there is no code in SaveGame yet. Replace the SaveGame function with the following code:
public void SaveGame()
{
  // 1
  Save save = CreateSaveGameObject();

  // 2
  BinaryFormatter bf = new BinaryFormatter();
  FileStream file = File.Create(Application.persistentDataPath + "/gamesave.save");
  bf.Serialize(file, save);
  file.Close();

  // 3
  hits = 0;
  shots = 0;
  shotsText.text = "Shots: " + shots;
  hitsText.text = "Hits: " + hits;

  ClearRobots();
  ClearBullets();
  Debug.Log("Game Saved");
}
Taking it comment-by-comment:
  1. Create a Save instance with all the data for the current session saved into it.
  2. Create a BinaryFormatter and a FileStream by passing a path for the Save instance to be saved to. It serializes the data (into bytes) and writes it to disk and closes the FileStream. There will now be a file named gamesave.save on your computer. The .save was just used as an example, and you could use any extension for the file save name.
  3. This just resets the game so that after the player saves, everything is in a default state.
To save the game, press Escape at any time during play and click the Save button. You should notice everything resets and the console output displays a note that the game has been saved.
Console output
LoadGame in the Game script is connected to the Load button. Open the Game script and locate the LoadGame function. Replace it with the following:
public void LoadGame()
{ 
  // 1
  if (File.Exists(Application.persistentDataPath + "/gamesave.save"))
  {
    ClearBullets();
    ClearRobots();
    RefreshRobots();

    // 2
    BinaryFormatter bf = new BinaryFormatter();
    FileStream file = File.Open(Application.persistentDataPath + "/gamesave.save", FileMode.Open);
    Save save = (Save)bf.Deserialize(file);
    file.Close();

    // 3
    for (int i = 0; i < save.livingTargetPositions.Count; i++)
    {
      int position = save.livingTargetPositions[i];
      Target target = targets[position].GetComponent();
      target.ActivateRobot((RobotTypes)save.livingTargetsTypes[i]);
      target.GetComponent().ResetDeathTimer();
    }

    // 4
    shotsText.text = "Shots: " + save.shots;
    hitsText.text = "Hits: " + save.hits;
    shots = save.shots;
    hits = save.hits;

    Debug.Log("Game Loaded");

    Unpause();
  }
  else
  {
    Debug.Log("No game saved!");
  }
}
Looking at this in detail:
  1. Checks to see that the save file exists. If it does, it clears the robots and the score. Otherwise it logs to the console that there is no saved game.
  2. Similar to what you did when saving the game, you again create a BinaryFormatter, only this time you are providing it with a stream of bytes to read instead of write. So you simply pass it the path to the save file. It creates the Save object and closes the FileStream.
  3. Even though you have the save information, you still need to convert that into the game state. This code loops through the saved robot positions (for living robots) and adds a robot at that position. It also sets it to the right type. For simplicity, the timers are reset, but you can remove this if you prefer. This prevents the robots from disappearing right away and gives the player a few seconds to get oriented in the world. Also, for simplicity, the animation of the robot moving up is set to finished, which is why robots partly moving up when you saved will be shown as fully up when a game is loaded.
  4. This updates the UI to have the right hits and shots set, and it sets the local variables so that when the player fires or hits a target it continues to count up on the value that was previously. If you didn’t do this step, the next time the player fires or hits a target the displayed values would get set to 1.
Click Play, play the game for a bit then save. Click the Load button and you will see it load the enemies as they were set up before when you saved the game. It also properly sets your score and the shots you’ve fired.
Game in progress

Saving Data With JSON

There’s one more trick you can use when you want to save data — and that is JSON. You could create a local JSON representation of your game save, send it to a server, then get that JSON (as a String) to another device and convert it from a string back to JSON. This tutorial won’t cover sending/receiving from the web, but it is very helpful to know how to use JSON — and it’s incredibly simple.
The format of JSON can be a little different than what you might be used from C# code, but it’s pretty straightforward. Here is a simple JSON example:
{
  "message":"hi",
  "age":22
  "items":
  [
    "Broadsword",
    "Bow"
  ]
}
The outer brackets represent the parent entity that is the JSON. If you are familiar with a Dictionary data structure, then JSON is similar. A JSON file is a mapping of key and value pairs. So the above example has 3 key-value pairs. With JSON, the keys are always strings, but the values can be objects (i.e. children JSON objects), arrays, numbers, or strings. The value set to the “message” key is “hi”, the value of the “age” key is the number 22, and the value of the “items” key is an array with two strings in it.
The JSON object itself is represented by a String type. By passing this data as a String, any language can easily re-create JSON object from the string as a constructor argument. Very convenient and very simple.
Each language has its own way of creating an object from this format. Since Unity 5.3, there exists a native method to create a JSON object from a JSON string. You will create a JSON representation of the high score of the player and then print it to the console. But you extend this logic by sending the JSON to a server.
The Game script has a method named SaveAsJSON that is hooked up to the Save As JSON button. Replace SaveAsJSON with the following code:
public void SaveAsJSON()
{
  Save save = CreateSaveGameObject();
  string json = JsonUtility.ToJson(save);

  Debug.Log("Saving as JSON: " + json);
}
This creates the Save instance like you did earlier. Then it creates a JSON string using the ToJSON method on the JsonUtility class. It then prints the output to console.
Start a game, hit a few targets, then press Escape to bring up the menu. Click the Save As JSON button, and you will see the JSON string you created:
Console output
If you want convert that JSON into a Save instance you would simply use:
Save save = JsonUtility.FromJson(json);
That is what you would do if you wanted to download a save file from the web and then load it into your game. But setting up a web server is a whole other process! For now, pat yourself on the back because you just learned a few techniques that will… save you some trouble in your next game (groan)!

Reference:  https://www.raywenderlich.com/160815/save-load-game-unity

Feb 10, 2018

Resolving harmless binding errors in WPF

While developing WPF applications, you will notice a lot of binding errors being displayed in output window; like this
System.Windows.Data Error: 4 : Cannot find source for binding with reference 
'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.DataGrid', 
AncestorLevel='1''. BindingExpression:Path=CellsPanelHorizontalOffset; DataItem=null; 
target element is 'Button' (Name=''); target property is 'Width' (type 'Double')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 
'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', 
AncestorLevel='1''. BindingExpression:Path=HorizontalContentAlignment; DataItem=null; 
target element is 'ComboBoxItem' (Name=''); target property is 
'HorizontalContentAlignment' (type 'HorizontalAlignment')

System.Windows.Data Error: 4 : Cannot find source for binding with reference 
'RelativeSource FindAncestor, AncestorType='System.Windows.Controls.ItemsControl', 
AncestorLevel='1''. BindingExpression:Path=VerticalContentAlignment; DataItem=null; 
target element is 'ComboBoxItem' (Name=''); target property is 
'VerticalContentAlignment' (type 'VerticalAlignment')
I also faced this problem and tried a lot of things to get to the root cause of the problem. It was very frustrating as AncestorLevel is not used anywhere in code! and I was not able to find the place in code which is responsible for these errors.
Even after searching the various forums and articles there was no solution for this problem; but this was a very common issue and cause of this problem as mentioned on various forums:
This is a "known" issue, and happens to all controls that contain dynamically created lists (all item controls i.e. ComboBox, menu, ListBox etc.).
ControlTemplate of items in these controls (specifically MenuItem, ComboBoxItem etc.)
try to find the nearest ItemsControl and bind to the VerticalAlignment and HorizonalAlignment properties and raises this error on not finding the source.
Microsoft guys mention here and here that “This error has already been handled internally, so you can just leave it alone.” But, still I wanted some sort of solution so as not to have so many irritating error messages in my output window;
Solution 1:
So, I tried one of the workaround provided for this problem i.e. to explicitly set the properties which cause problems like this -
<ComboBox
    Name="control">
    <ComboBox.ItemContainerStyle>
        <Style
            TargetType="ComboBoxItem">
            <Setter
                Property="HorizontalContentAlignment"
                Value="Left" />
            <Setter
                Property="VerticalContentAlignment"
                Value="Center" />
        </Style>
    </ComboBox.ItemContainerStyle>
</ComboBox>
This works but it’s very hard task to set these properties across the whole solution for each problematic control(i.e. ListBox, Menu, ContextMenus etc.).
Have a look at this SO question for some other workarounds for this problem - ListBox with Grid as ItemsPanelTemplate produces weird binding errors
Solution 2:
Another workaround is to suppress these errors (actually, it seems more appropriate to call them warnings) by setting the data binding source switch level as critical in constructor of the class or a top level window -
#if DEBUG 
System.Diagnostics.PresentationTraceSources.DataBindingSource.Switch.Level = System.Diagnostics.SourceLevels.Critical;
#endif
I find this one line workaround more appropriate as it works for all such controls (like Menus, ListBox etc.) and that too across the whole project  -

REFERENCE : https://weblogs.asp.net/akjoshi/resolving-un-harmful-binding-errors-in-wpf

Unity Volumetric Light Error on Mac OSX

When I get build from Unity for Mac OS X and run the game on Mac OSX, I get

ERROR:

Initialize engine version: 2017.3.0f3 (a9f86dcd79df)
GfxDevice: creating device client; threaded=1
2018-02-07 12:42:57.410 btm[28692:5744936] Color LCD preferred device: Intel HD Graphics 5000 (high power)
2018-02-07 12:42:57.410 btm[28692:5744936] Metal devices available: 1
2018-02-07 12:42:57.410 btm[28692:5744936] 0: Intel HD Graphics 5000 (high power)
2018-02-07 12:42:57.411 btm[28692:5744936] Forcing user selected device: Intel HD Graphics 5000 (high power)
Initializing Metal device caps: Intel HD Graphics 5000
Begin MonoManager ReloadAssembly
- Completed reload, in  0.137 seconds
WARNING: Shader Unsupported: 'Sandbox/VolumetricLight' - Pass '' has no vertex shader
ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Sandbox/VolumetricLight' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BilateralBlur' - Pass '' has no vertex shader
ERROR: Shader Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)WARNING: Shader Unsupported: 'Hidden/BilateralBlur' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/VideoDecodeOSX' - Pass 'FLIP_RGBARECT_TO_RGBA' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/VideoDecodeOSX' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitToDepth' - Setting to default shader.
WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Pass '' has no vertex shader
WARNING: Shader Unsupported: 'Hidden/BlitToDepth_MSAA' - Setting to default shader.
Metal RecreateSurface[0x10d626e60]: surface size 1440x900
Setting up 2 worker threads for Enlighten.
  Thread -> id: 7000014b6000 -> priority: 1
  Thread -> id: 700001539000 -> priority: 1
UnloadTime: 4.903137 ms

Trying to access pass 4, but material 'Sandbox/VolumetricLight' subshader (0) has only 1 valid passes.
UnityEngine.Material:SetPass(Int32)
VolumetricLight:SetupDirectionalLight(VolumetricLightRenderer, Matrix4x4) (at C:\Users

Invalid pass number (5) for Graphics.Blit (Material "Hidden/BilateralBlur" with 1 passes)
UnityEngine.Graphics:Internal_BlitMaterial(Texture, RenderTexture, Material, Int32, Boolean)
UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/GraphicsBindings.gen.cs:2343)
VolumetricLightRenderer:OnRenderImage(RenderTexture, RenderTexture) (at /Users/Shared/Unity/eatallthe/Assets/Volumetric/Scripts/VolumetricLightRenderer.cs:343)

FIX:  

1- Edit > Project Settings > Player


2 - From Other Settings > Rendering, Uncheck "Auto Graphics API for Mac"

4- Re-Order as OpenGLCore appears above Metal


Jan 17, 2018

Top 5 Free Unity Assets

The Unity Asset Store is a treasure chest of awesome tools for building games. Most of the offers are paid, but did you know that there are some powerful and very useful assets released for free? Such quality solutions are not only friendly to budget-sensitive indie developers but often beat the paid offers in terms of usability. On top of all, the free Unity Assets are a great way to get started with serious Unity game development.
Here is our list of the Top 5 Best Free Assets on the Unity Store!

1. iTween – Free Unity Scripting Library.

iTween is a free and feature-rich animation system for Unity. It is one of the first assets I personally add to a new game project. It grants you access to dozens of useful functions which help you animate the exposed (i.e. public) values of any component!
iTween Unity Asset Path Example
Let’s say you want to move an object along a path. One way to do that is to create waypoints (empty gameObjects) and then use iTween to move your object from one waypoint to the next. Here is an example of how simple this is to accomplish with the tween library:
And that’s it! Your object will move reliably following the waypoints. You can explore the many uses of iTween in its detailed Documentation.

2. ProBuilder Basic – Free Unity 3D Modeling Editor Extension.

ProBuilder Basic Unity Asset Example
Build the geometry of your game levels directly in the Unity editor! Whether you need to create a quick prototype of your game, or to go deep into world-building, ProBuilder Basic is capable and easy to use.
The fact that you are working in the Unity Editor and not inside an external program means you can play-test everything instantly. A huge time-saver and an awesome asset!

3. “Unity-chan!” Model – Free Unity 3D Character Model.

Unity Chan 3D Model Asset Example
As far as characters go, the Kohaku Ootori Unity 3D model is one of the cutest and most skillfully designed on the Asset Store. Kohaki comes with 31 animations, 31 still poses, 12 Emotions making from blend shapes and beautiful textures and shaders.
You can use the cute 3D girl in your finished game or just as a nice model to look at in your prototype :).

4. Tanks! – Free Unity Sample Project – Tutorial.

Tanks Unity Asset Two Players Example
Of all Unity Tutorial projects this one is my favorite – it is a great introduction to Game Planning, Physics, Inputs and Audio Mixing. And on top of that – the completed project is a fun little game for two players.
The idea is so good, that ever since I played it, I’ve wanted to create a published spin-off :). Download it, follow along the tutorial if you are new to Unity, or just use it as inspiration for your next game!

5. Absolutely Free Music – for use in your Unity games.

The importance of game music is too often underestimated by aspiring game developers. The Audio atmosphere should not be an afterthought, as it can noticeably improve the gaming experience. A good place to start are the audio track in the Absolutely Free Music Unity Asset. The pack includes 41 compositions in various genres – from rock and instrumental, to trance and ambient. A careful selection of these tracks would definitely make a prototype or even a finished product much more impressive!

This was our collection of most useful Free Unity Assets. Grab some of these free goodies and have fun building games! 🙂

Reference: https://ironic.games/unity-asset-store-reviews/top-5-free-assets

Visual Studio Keyboard Shortcuts

Playing with keyboard shortcuts is very interesting and reduce the headache of using the mouse again and again while programming with visu...