블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2737)
Unity3D (817)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (58)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (53)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
04-29 00:03


모바일 게임 최적화의 정석 - 텍스처 압축 편


모바일 게임 최적화의 정석 - 렌더링 편


모바일 게임 최적화의 정석 - 메모리 편


반응형
Posted by blueasa
, |

Doxygen For Unity

Unity3D/Tips / 2014. 9. 11. 10:18



DoxygenForUnity.zip




Link : http://www.jacobpennock.com/Blog/?p=629

반응형
Posted by blueasa
, |

Mesh has more materials (2) than subsets (1)

UnityEditor.UnityBuildPostprocessor:OnPostprocessScene()


필요에 의해서 만들어진 모델에 매트리얼을 1개 더 추가(최종 2개가 됨)를 했는데,


실행해보면 위의 경고를 띄우면서 1개만 남기고 추가된 매트리얼이 없어진다.


다른 이유도 있을 수 있겠지만, 이번 경우는 모델에 static이 체크 돼 있어서 매쉬를 컴바인하면서 매트리얼을 2개이상 못쓰게 막는 문제였다.


그래서..!!


[결론]

static 꺼 줌..


P.s. 최적화를 위해서 static을 쓰면 좋겟지만, 매트리얼이 2개 이상 필요하다면 어쩔 수 없는 듯..

       원한다면 매트리얼이 2개 이상 필요한 곳 만 빼고 static으로 묶던지 해야 될 듯..

반응형
Posted by blueasa
, |

Tree Pack(FBX)

Unity3D/Link / 2014. 9. 3. 15:37

Link : http://www.themantissa.net/resources/


반응형

'Unity3D > Link' 카테고리의 다른 글

Unity Cloud Data 소개  (0) 2015.01.20
unity3d grid  (0) 2014.12.19
awesome-unity - UNITY 관련 자료 모음 GitHub 프로젝트  (0) 2014.08.14
유니티 짱(Unity Chan)  (0) 2014.04.11
모바일 게임 버전 관리 정책  (0) 2014.02.25
Posted by blueasa
, |



게시일: 2013. 8. 2.

Like most Unity developers, I've encountered the "Missing Script" issue dozens of times in Unity. I finally had enough of having to hand-edit each component to resolve the issue, and wrote an editor extension to help identify and resolve the issue. This video shows a little bit about how it's used.

You can read more about this utility and download the UnityPackage for free on my website at

http://daikonforge.com/forums/resources/fix-missing-scripts.3/



[file]


DaikonForge.MissingScriptResolver.unitypackage



출처 : http://www.youtube.com/watch?v=xz0wbAA3iW0


반응형
Posted by blueasa
, |

Extension Methods

Unity3D/Extensions / 2014. 8. 18. 02:30

Extension Methods

Posted by  on December 6th, 2013

Oftentimes you’ll find yourself using classes you can’t modify. Whether they’re basic data types or part of an existing framework, you’re stuck with the functions that are provided. That being said, C# provides a nifty trick to appending functions to classes! These are known as Extension Methods.

Extension methods are fairly simple to create and are frequently used as syntactic sugar. A practical example can be seen with Unity’s Transform class. Let’s say you want to set only the xvariable of Transform.position.

using UnityEngine;
using System.Collections;
 
public class Player : MonoBehaviour
{
    void Update ()
    {
        //Set new x position to 5
        transform.position = new Vector3(5f, transform.position.y, transform.position.z);
    }
}

In this case Transform.position gives you an error if you only try to assign its x member variable, so you have to assign the entire Vector3. An extension method such as SetPositionX() could be appended to the Transform class and help make this code more readable.

In order to create extension methods you have to create a static class. In addition, an extension method declaration must be declared static and have the first parameter be of the type that you’re writing the method for, preceded by the this keyword.

using UnityEngine;
using System.Collections;
 
//Must be in a static class
public static class Extensions
{
    //Function must be static
    //First parameter has "this" in front of type
    public static void SetPositionX(this Transform t, float newX)
    {
        t.position = new Vector3(newX, t.position.y, t.position.z);
    }
}

Now you can go back to your other script and replace our old code with the new extension method.

using UnityEngine;
using System.Collections;
 
public class Player : MonoBehaviour
{
    void Update ()
    {
        //Set new x position to 5
        transform.SetPositionX(5f);
    }
}
NOTE: Extension methods can only be called on an instance of a class, not on the class itself.

Here are a few more extension methods to get you started, as well as an example script that utilizes a few of them.

Extensions:

using UnityEngine;
using System.Collections;
 
public static class Extensions
{
    public static void SetPositionX(this Transform t, float newX)
    {
        t.position = new Vector3(newX, t.position.y, t.position.z);
    }
 
    public static void SetPositionY(this Transform t, float newY)
    {
        t.position = new Vector3(t.position.x, newY, t.position.z);
    }
 
    public static void SetPositionZ(this Transform t, float newZ)
    {
        t.position = new Vector3(t.position.x, t.position.y, newZ);
    }
 
    public static float GetPositionX(this Transform t)
    {
        return t.position.x;
    }
 
    public static float GetPositionY(this Transform t)
    {
        return t.position.y;
    }
 
    public static float GetPositionZ(this Transform t)
    {
        return t.position.z;
    }
 
    public static bool HasRigidbody(this GameObject gobj)
    {
        return (gobj.rigidbody != null);
    }
 
    public static bool HasAnimation(this GameObject gobj)
    {
        return (gobj.animation != null);
    }
 
    public static void SetSpeed(this Animation anim, float newSpeed)
    {
        anim[anim.clip.name].speed = newSpeed;
    }
}

Example Script:

using UnityEngine;
using System.Collections;
 
public class Player : MonoBehaviour
{
    void Update ()
    {
        //move x position 5 units
        float currentX = transform.GetPositionX();
        transform.SetPositionX(currentX + 5f);
 
        if(gameObject.HasRigidbody())
        {
            //Do something with physics!
        }
 
        if(gameObject.HasAnimation())
        {
            //Double the animation speed!
            gameObject.animation.SetSpeed(2f);
        }
    }
}
NOTE: Static classes do NOT extend MonoBehaviour.
ANOTHER NOTE: If you define your extension methods inside of a namespace, you have to declare the use of that namespace in order to bring them into scope.


출처 : http://unitypatterns.com/extension-methods/

반응형
Posted by blueasa
, |

Nullable Types

Unity3D/Extensions / 2014. 8. 18. 02:29

Nullable Types

Posted by  on January 14th, 2014

Sometimes you have variables that have important information but only after certain game events occur. For example: A character in your game may be idle until they’re told to go to an assigned destination.

public class Character : MonoBehaviour
{
    Vector3 targetPosition;
 
    void MoveTowardsTargetPosition()
    {
        if(targetPosition != Vector3.zero)
        {
            //Move towards the target position!
        }
    }
 
    public void SetTargetPosition(Vector3 newPosition)
    {
        targetPosition = newPosition;
    }
}

In this case, we want the character to move towards the target position only if it’s been assigned. In the code above, we do this by just checking if targetPosition is not equal to its default value (0, 0, 0).  But now we have an issue: what if you want your character to move to (0, 0, 0)? You don’t want to discredit the possibility of that value being used because it might come up sometime during the game!

Luckily, there’s a trick to help avoid comparing arbitrary values for confirming that a variable has been initialized: Nullable Types.

Using Nullable Types

To make a nullable type, just add a “?” after the type declaration of any variable that is a Value Type (eg. Vector3, Rect, int, float).

public class Character : MonoBehaviour
{
    //Notice the added "?"
    Vector3? targetPosition;
 
    void MoveTowardsTargetPosition()
    {
        if (targetPosition.HasValue)
        {
            //Move towards the target position!
            //use targetPosition.Value for the actual value
        }
    }
 
    public void SetTargetPosition(Vector3 newPosition)
    {
        targetPosition = newPosition;
    }
}

Seen here, nullable types have two properties we can use: HasValue (true if the variable has been assigned, false otherwise), and Value (the actual assigned value of the variable).

//First, check if the variable has been assigned a value
if (targetPosition.HasValue)
{
    //move towards targetPosition.Value
}
else
{
    //targetPosition.Value is invalid! Don't use it!
}

Usage Notes

  • To revert a nullable type to having “no value”, set it to null
  • You can NOT create nullable types from classes, or reference types (they can already be set to null)

As usual, if you have any questions or tips to add, do so in the comments below!



출처 : http://unitypatterns.com/nullable-types/

반응형

'Unity3D > Extensions' 카테고리의 다른 글

일괄적으로 Texture Import Setting 변경  (0) 2015.01.30
Extension Methods  (0) 2014.08.18
ObjectPool  (0) 2014.04.22
인스펙터 상의 GUI를 비활성화 시키고 싶을 때..  (0) 2014.04.02
Save Scene while on play mode  (0) 2014.01.12
Posted by blueasa
, |

Link : https://github.com/RyanNielson/awesome-unity



Awesome Unity

A curated list of awesome Unity assets, projects, and resources.

Inspired by awesome-rubyawesome-php, and awesome-python.

2D

  • 2d Toolkit - An efficient & flexible 2D sprite, collider set-up, text, tilemap and UI system.
  • Ferr2D Terrain Tool - Quickly create handcrafted 2D landscapes and levels.
  • SmoothMoves - A skeletal animation editor.
  • Spine - A skeletal animation editor with a Unity library.

AI

  • A* Pathfinding Project (Free and paid) - Lightning fast pathfinding with heavily optimized algorithms and a large feature set.
  • Rain (Free) - A toolset that provides integrated AI rigging, a visual behavior tree editor, pathfinding, automatic nav grid generation, and more.

Camera

  • UFPS - Provides camera, controllers, and other effects for use in FPS games.

Character Controllers

Frameworks

  • uFrame - Create maintainable games faster, better, more stable, and consistent than ever before.

Input

  • InControl (Free) - An input manager that tames makes handler cross-platform. controller input easy.
  • TouchKit (Free) - Makes it easy to recognize gestures and other touch input.

Networking

  • Bolt - Build networked games without having to know the details of networking or write any complex networking code.
  • Photon Unity Networking (Free) - Plug and play cloud networking that also works for local hosting. Free for up to 20 concurrent users.

Textures

Tweening

  • GoKit (Free) - An open source, lightweight tween library aimed at making tweening objects dead simple.
  • HOTween (Free) - Tween any numeric property or field (including Vectors, Rectangles, etc.), plus some non-numeric ones (like strings).
  • iTween (Free) - A simple, and easy to use animation system.
  • LeanTween (Free) - FOSS, and also the most lightweight tweening library for Unity. Allows you to tween any value you have access to via the .value() method.

UI

  • Daikon Forge - A user interface library that provides deep editor integration, data/event binding, and much more.
  • NGUI - A powerful UI system and event notification framework.

Visual Scripting

  • Playmaker - Quickly make gameplay prototypes, A.I. behaviors, animation graphs, interactive objects, and more using finite state machines.
  • Shader Forge - A node-based shader editor giving you the artistic freedom of shader creation, with no need to code.

Projects

A list of awesome projects made using Unity.

Resources

Tutorials

  • Catlike Coding - Tutorials designed for learning the C# scripting side of Unity.
  • Official Video Tutorials - The official tutorials for scripting, animation, audio, and almost anything Unity related.
  • Unity Patterns - Software pattern tutorials and free tools for Unity.

Contributing

Please see CONTRIBUTING for details.

반응형

'Unity3D > Link' 카테고리의 다른 글

unity3d grid  (0) 2014.12.19
Tree Pack(FBX)  (0) 2014.09.03
유니티 짱(Unity Chan)  (0) 2014.04.11
모바일 게임 버전 관리 정책  (0) 2014.02.25
유니티 C# 관련 사이트  (0) 2012.10.24
Posted by blueasa
, |


UIJoystick.cs


Reference : https://gist.github.com/shori0917/6094473



Link : http://blog.kanotype.net/?p=695



반응형
Posted by blueasa
, |

원문 링크 : http://unityvs.com/news/



MS를 통해서 나오고 Free로 풀렸네요.


예상보다 상당히 빠르네요.

이미 사서 쓰고 있지만, Free로 풀린거 보니 좋네요. =ㅅ=;;

아래는 원문..

29 Jul 2014

permalink

The team is proud to announce the 1.9 release of Visual Studio Tools for Unity, formerly known as UnityVS, our fist release since we've been acquired by Microsoft.

Please see the annoucement on the Visual Studio blog. To know exactly what changed, you can go directly to the ChangeLog.

Visual Studio Tools for Unity is now directly available from the Visual Studio Gallery, for each of the Visual Studio version we support:

UnityVS 1.8 to VSTU 1.9 migration

If you are migrating an existing UnityVS 1.8 solution, we recommend that you:

  • Delete the UnityVS .sln and .*proj files from the root folder of your Unity project.
  • Import the new Visual Studio Tools for Unity package into your Unity project as shown in the documentation.
Your new solution will be automatically generated.


반응형

'Unity3D > UnityVS' 카테고리의 다른 글

[UnityVS] Script opening with Unity 4.2  (0) 2013.08.06
Posted by blueasa
, |