Tag Archives: unity

C# Conditional Attribute


public class TestMonoBehaviour : MonoBehaviour
    void Start()

    public void ConditionalTest(string testData)
        Debug.Log("ConditionalTest " + testData);

    public string TestFunction()
        return "TestFunction";

if use #undef TEST_CONDITIONAL
No log will be write.

if use #define TEST_CONDITIONAL

will write to console.

FBCross Windows Phone Unity 5 Setup

How can Facebook Windows Phone Dlls Import in Unity5 ?

– After imported Facebook Windows Phone, you have to set import settings of Dlls.

☛ Select “Assets/FBCross/FBCross.dll” , only check platforms for “Editor” and click Apply


☛ Select “Plugins/WP8/FBCross/FBCross.dll” set settings ;
1-) Only check platform for “WP8Player”
2-) Set Placeholder to “Assets/FBCross/FBCross.dll”.


Unity Exception :

Plugin ‘FBCross.dll’ is used from several locations:
Assets/FBCross/FBCross.dll would be copied to /FBCross.dll
Assets/Plugins/WP8/FBCross/FBCross.dll would be copied to
Please fix plugin settings and try again.

UnityEditorInternal.PluginsHelper:CheckFileCollisions(BuildTarget) (at C:/buildslave/unity/build/Editor/Mono/Plugins/PluginsHelper.cs:25)

Plugins colliding with each other.

Windows Phone Multi Language App Title and Tile Title

1- Download this project : https://code.msdn.microsoft.com/windowsapps/Language-Neutral-Resource-5894846e
2- Open project using visual studio
3- First we will create default language dll file;
– Double click AppResLib.rc file which is located under “Resouce Files” folder.
– “Resource View” will be open . Double Click “String Table” file

You will see like this table;

ID     Value   Caption

Dont change “ID” and “Value” values.Only Set Caption values.

4- Build AppResLib project at “Release” mode.
5- Copy “AppResLib.dll” to any other location.Because we will build again and we need this file. (For Example : Desktop/AppNames) . Default Language Dll ready!
6- Open again “AppResLib.rc” file change Caption name(For Example : Enter Japanese App Name) and build again.Rename AppResLib.dll file according to locale ID.you can find here : https://msdn.microsoft.com/library/windows/apps/ff967550(v=vs.105).aspx (Windows Phone 8 supported display languages)
Ex : Rename AppResLib.dll -> AppResLib.dll.0411.mui (for Japanese ) and Japanese language ready.
7- Copy this file to where you copy to Default language file “AppResLib.dll” . (For Example : Desktop/AppNames)
8- Your Multi language files ready..If you need more language file.Repeat 6,7

9- Open your Windows Phone project.Right Click on Your Project -> Add -> Existing Item… -> Select “AppResLib.dll” file and “AppResLib.dll.0411.mui” files.
10- Right Click on “AppResLib.dll” and “AppResLib.dll.0411.mui” files -> Properties -> Build Action -> change to “Content”
11- Extend “Properties” -> Double Click on WMAppManifest.xml
12- Change Display Name to : @AppResLib.dll,-100
and change Tile Title to : @AppResLib.dll,-200
13- Build and RUN !

More Info : https://msdn.microsoft.com/library/windows/apps/ff967550(v=vs.105).aspx
If you follow up More Info instructions.Do not move .umi files to “Resources” folder.

Windows Phone Application and Store Image,Icon Sizes

Application Image Sizes

FlipCycleTileLarge -> 691×336
FlipCycleTileMedium -> 336×336
FlipCycleTileSmall -> 159×159
IconicTileMediumLarge ->134×202
IconicTileSmall -> 71×110
ApplicationIcon -> 100×100

SplashScreenImagePortraitUpsideDown ->768×1280

Store Image Sizes

App Icon -> 300×300
Screenshot(8 adet gerekmektedir.) -> 1280×768
Promototional Background ->1000×800
Promototional Square Icon ->358×358
Promototional Wide Icon ->358×173

Debug Windows Phone Unity Codes

Debug Windows Phone Unity Codes

1 – Build Visual Studio project for Windows Phone (File -> Build Settings -> Build).
2 – Open Generated Visual Studio Project.
3 – Click FILE -> Add -> Existing Project, navigate to Unity project folder and select Assembly-CSharp.csproj file.
4 – Go to BUILD -> Configuration Manager and make sure ARM platform is selected for your project.
5 – Optionally uncheck Build flag for Assembly-CSharp since it has already been built by Unity.
6 – Add breakpoint(s) to your script file(s).
7 – Make sure phone is connected to PC and Wphone Screen is unlocked.
8 – Make sure debugger type is set to Managed Only (default).
9 – Hit F5 to build, deploy, run and debug your app.

Unity Take Screenshot in Editor

Take Screenshot in Unity3d

using UnityEngine;
using System.Collections;
using System;

public class ScreenShoter : MonoBehaviour
    public KeyCode screenShotKeyCode;
	public string filePath;
    void Update()
        if (Input.GetKeyDown(screenShotKeyCode))
filePath,Screen.width,Screen.height,System.DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds));

First IOS Build with Unity3d

First IOS Build with Unity3d

1.1.Buy apple developer licence.
1.2.You need to be apple developer certificate = > http://www.youtube.com/watch?v=HlRI30F6-Ek
1.3.Plug your test device on Imac.
1.4.You need to add your test device(Iphone,Ipad) other way provisioning on an IOS Device => http://www.youtube.com/watch?v=mX4v9A2bpjs
1.5.Download xcode and setup.
1.6.Start unity and File ->click build and run

First Build is Ready.