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

카테고리

분류 전체보기 (2741)
Unity3D (30)
Programming (475)
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 (54)
Android (15)
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
05-19 00:09

링크 : http://hompy.info/664



CoverFlowScroll.unitypackage



요즘 제작중인 RPG 게임 GUI 에서 영웅 생성을 위해 캐릭터를 선택하는 UI 를 커버플로우(Cover Flow)로 구성하게 되어 NGUI 를 조금 응용해서 심플하게 구성해봤습니다. 아래 동영상과 유니티 데모를 보시면 대략 어떤 것인지 아실 수 있을 것이며 혹시나 구현 방법에 대해 관심 있는 분들은 첨부 파일을 받아서 패키지 임포트로 유니티에서 가져가 내용을 살펴 보시면 되겠습니다. NGUI 외에도 트위닝 모션을 위해 HOTween 플러그인을 사용하는 코드가 있으나 수정해서 쓰셔도 되겠습니다. 그리고 데모에 보이는 캐릭터 디자인 소스는 에셋 스토어에서 구입한 것이네요. NGUI 플러그인에 이런 기능도 포함되면 좋을 것 같은데 안된다면 아쉽지만 저처럼 이렇게 구현해야 되겠지요.^^ 여러분은 지금 어떤 기능들을 추가해보고 있나요?

[유니티 데모 링크] http://www.hompydesign.com/tmp/coverflow/

[패키지 첨부파일]  CoverFlowScroll.unitypackage

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using Holoville.HOTween;
using Holoville.HOTween.Plugins;

public class HeroTable : MonoBehaviour {
   UISprite[] heros;

   Transform mTrans;
   bool mIsDragging = false;
   Vector3 mPosition, mLocalPosition;
   Vector3 mDragStartPosition;
   Vector3 mDragPosition;
   Vector3 mStartPosition;
   
   public float cellWidth = 160f;
   public float downScale = 0.4f;
   public int cellTotal = 6;
   public int seq = 3;
   
   public UILabel titleLabel;
   
   // Use this for initialization
   void Start () {
       StartCoroutine( DelayStart(1f) );
   }
   void Awake(){
       mTrans = transform;
       mPosition = mTrans.position;
       mLocalPosition = mTrans.localPosition;
   }
   
   IEnumerator DelayStart(float delayTime) {
       yield return new WaitForSeconds(delayTime);
       heros = gameObject.GetComponentsInChildren<UISprite>();
       SetPosition(false);
   }
   
   void SetSequence(bool isRight){
       Vector3 dist = mLocalPosition - mTrans.localPosition;
       float distX = Mathf.Round(dist.x/cellWidth);
       seq = (int)distX;
       if (seq >= cellTotal) seq = cellTotal - 1;
       if (seq <= 0) seq = 0;
   }
   
   void SetPosition(bool isMotion){
       Vector3 pos = mLocalPosition;
       pos -= new Vector3(seq * cellWidth, 0f0f);
       if (isMotion) {
           TweenParms parms = new TweenParms();
           parms.Prop("localPosition", pos);
           parms.Ease(EaseType.Linear);
           HOTween.To(mTrans, 0.1f, parms);
           HOTween.Play();
       else {
           mTrans.localPosition = pos;
       }
       titleLabel.text = heros[seq].spriteName;
   }

   void Drop () {
       Vector3 dist = mDragPosition - mDragStartPosition;
       if (dist.x>0f) SetSequence(true);
       else SetSequence(false);
       SetPosition(true);
   }

   void OnDrag (Vector2 delta) {
       Ray ray = UICamera.currentCamera.ScreenPointToRay(UICamera.lastTouchPosition);
       float dist = 0f;
       Vector3 currentPos = ray.GetPoint(dist);

       if (UICamera.currentTouchID == -|| UICamera.currentTouchID == 0) {
           if (!mIsDragging) {
               mIsDragging = true;
               mDragPosition = currentPos;
           else {
               Vector3 pos = mStartPosition - (mDragStartPosition - currentPos);
               Vector3 cpos = new Vector3(pos.x, mTrans.position.y, mTrans.position.z);
               mTrans.position = cpos;
           }
       }
   }

   void OnPress (bool isPressed) {
       mIsDragging = false;
       Collider col = collider;
       if (col != null) {
           Ray ray = UICamera.currentCamera.ScreenPointToRay(UICamera.lastTouchPosition);
           float dist = 0f;
           mDragStartPosition = ray.GetPoint(dist);
           mStartPosition = mTrans.position;
           col.enabled = !isPressed;
       }
       if (!isPressed) Drop();
   }
}

using UnityEngine;
using System.Collections;

public class HeroItem : MonoBehaviour {
   Transform mTrans, mParent;
   Vector3 scale;
   float cellWidth;
   float downScale;
   HeroTable hTable;

   void Start () {
       mTrans = transform;
       scale = mTrans.localScale;
       mParent = mTrans.parent;
       hTable = mParent.GetComponent<HeroTable>();
       cellWidth = hTable.cellWidth;
       downScale = hTable.downScale;
   }
   
   void Update () {
       Vector3 pos = mTrans.localPosition + mParent.localPosition;
       float dist = Mathf.Clamp(Mathf.Abs(pos.x), 0f, cellWidth);
       mTrans.localScale = ((cellWidth - dist*downScale) / cellWidth) * scale;
   }
}

반응형
Posted by blueasa
, |

3D Model Viewer

Unity3D/Utility / 2013. 1. 18. 12:50

링크 : http://www.youtube.com/watch?annotation_id=annotation_250755&feature=iv&src_vid=yySljuVOBg8&v=6fjgxhmLteQ








Dropbox link:http://dl.dropbox.com/u/19470409/Unity/Model%20Viewer%20Orbit.rar


This is a tutorial how to use this simple model Viewer.

For new model:
You just import your FBX file attach the Model_Animations.cs script and re-enter the animations and make a Prefab of it.
The just Add It at the SpawnPoint prefab. Like i show in the video.


반응형
Posted by blueasa
, |

Unity3D Tools

Unity3D/Utility / 2013. 1. 18. 12:22

Unity3D Tools

Unity3D GUI & 2D Sprite Tools
http://danim.tv/blog/archives/unity3d-gui-2d-sprite-tools

Unity3D Level Editor
http://danim.tv/blog/archives/unity3d-level-editor

Unity3D Game Mechanics & AI Tools
http://danim.tv/blog/archives/unity3d-game-mechanics-ai-tools/

Unity3D Input Tools
http://danim.tv/blog/archives/unity3d-input-tools

Doc Search
http://www.lemodev.com/products/doc-search.php
http://u3d.as/content/lemo-dev/doc-search/34w

UnIDE
http://unityide.com
https://www.assetstore.unity3d.com/#/content/6070

Script Inspector
http://forum.unity3d.com/threads/138329
https://www.assetstore.unity3d.com/#/content/3535

Favorites Tabs
http://forum.unity3d.com/threads/149856
https://www.assetstore.unity3d.com/#/content/4237

iTween
http://www.pixelplacement.com/iTween/

iTween Visual path editor
http://pixelplacement.com/2010/12/03/visual-editor-for-itween-motion-paths/

iTween Visual Editor
http://dkoontz.wordpress.com/2010/10/27/itween-visual-editor/

HOTween + HOTween Visual Editor – fast & robust tween engine, type-safe object-oriented
http://www.holoville.com/hotween
http://forum.unity3d.com/threads/118515
http://code.google.com/p/hotween/

Pool Manager
http://poolmanager.path-o-logical.com
http://u3d.as/content/path-o-logical-games-llc/pool-manager/1Z4

Object Pooling Class
http://unity.clockstone.com/assetStore-objectPoolingClass.html

Playmaker – visual scripting tool
http://hutonggames.com/playmaker.html
http://forum.unity3d.com/threads/72349

Antares Project
http://forum.unity3d.com/viewtopic.php?t=50843

uScript Visual Scripting Tool
http://forum.unity3d.com/threads/84594

Brain Builder
http://boldai.com

Unity 3 Node Based Shader Editor
http://forum.unity3d.com/viewtopic.php?t=60174

SceneMate – toolbar to increase workflow speed
http://u3d.as/content/tim-wiese/scene-mate/3JY

PlayModePersist
https://www.assetstore.unity3d.com/#/content/188

Shortcuts Editor
http://forum.unity3d.com/viewtopic.php?t=64494

Edit multiple gameobjects
http://forum.unity3d.com/threads/68102

Game Translator – by the Google Translate API
http://forum.unity3d.com/threads/81538

Translation Editor
http://forum.unity3d.com/threads/85129

Unity Localization Framework (ULF) for Language localization
http://www.bitwisedesign.com/unity/localization
http://forum.unity3d.com/threads/53481

Font Texture Builder + Unity Importer
http://rouheegames.com/FTB/

RapidUnity Light Library
http://www.alabsoft.com/lightlib.shtml
http://forum.unity3d.com/threads/56255

RapidUnity Array Wizard
http://www.alabsoft.com/arraywiz.shtml
http://forum.unity3d.com/threads/59935

Array based Object Placement Tool (Editor Extension)
http://forum.unity3d.com/threads/84902

TransformUtilities
http://www.blog.silentkraken.com/2010/02/06/transformutilities/

FMODUnity .NET Plugin
http://www.squaretangle.com/FMODUnity.html
http://forum.unity3d.com/threads/28548

UniLOD – Level-of-detail and streaming support
http://forum.unity3d.com/viewtopic.php?t=45295

FaceFX – Facial animation integration
http://forum.unity3d.com/threads/63573
http://www.facefx.com/page/unity-demo

UnitySteer
http://www.arges-systems.com/articles/48/unitysteer-20-released

uniSWF – Convert Adobe Flash to Unity3D UI Solution
http://uniswf.com

Convert Unity Javascript (unityscript) to C#
http://www.m2h.nl/files/js_to_c.php

Convert C# to Boo
http://codeconverter.sharpdevelop.net/SnippetConverter.aspx

LibNoise ported to Unity (Perlin, RiggedMultifractal, Voronoi, Billow Noises)
http://forum.unity3d.com/threads/68764

Griddy – Unity Grid Toolkit
http://forum.unity3d.com/threads/50108

Nimbus – Cloud System
http://happyface3d.com

RageSpline – Create smooth 2D graphics inside Unity Editor
http://forum.unity3d.com/threads/86772

Mega-fiers modifiers – 3D Mesh Modifier System
http://west-racing.com/mega-fiers/

Game Draw 3D modeling
http://gamedraw3d.com

SmartFoxServer: massive multiplayer server for MMO
http://www.smartfoxserver.com

Exit Games – Game Network Engines, MMO Server
http://www.exitgames.com

ElectroServer5 – For client-server games Flash, Unity3D, iPhone/iPad, and Android
http://www.electrotank.com

Irc Chat
http://forum.unity3d.com/threads/68070

Vehicle Editor Resource Pack
http://www.alabsoft.com/rapidunity.shtml

EasyRoads3D – Road Systems for Unity
http://unityterraintools.com
http://forum.unity3d.com/viewtopic.php?t=23519

Road/Path Tool – River Tool – Terrain Toolkit
http://www.sixtimesnothing.com/tools-and-resources/

Road Network Generator
http://forum.unity3d.com/threads/83961
http://dl.dropbox.com/u/18986451/GrantSimpleSoftware/roadNetworkGenerator.html

Terrain 4 Mobile System
http://www.store.azert2k.fr/?page_id=244

Unity3D Obfuscator – a special protection tool
http://en.unity3d.netobf.com
http://forum.unity3d.com/threads/51356

Stitchscape – ObjReader – UniFileBrowser – Fractscape
http://www.starscenesoftware.com/Utilities.html

Vectrosity (Line, Circle, Ellipse, Grid & Selection)
http://starscenesoftware.com/vectrosity.html
http://forum.unity3d.com/viewtopic.php?t=53268

Audio Toolkit
http://unity.clockstone.com
https://www.assetstore.unity3d.com/#/content/2647
Audio Toolkit Free
https://www.assetstore.unity3d.com/#/content/2679

Master Audio
https://www.assetstore.unity3d.com/#/content/5607

Mixamo – Animation Driven Playable Character
http://www.mixamo.com

faceAPI
http://www.andysaia.com/radicalpropositions/?p=197

Text to Speech [Dll] for Win32
http://forum.unity3d.com/viewtopic.php?t=60020

M2HCulling: Optimize your game – culling system for Unity
http://forum.unity3d.com/viewtopic.php?t=55686

UnityDevs Tools (Cubemaps Generator – Automatic progress bars load)
http://unitydevs.com

3D Anaglyph System
http://www.store.azert2k.fr

Stereoskopix3D
http://forum.unity3d.com/threads/63874-stereo-3D-in-Unity-3D?p=416458#post416458

Browsing the web within Unity Editor
http://forum.unity3d.com/threads/67149

Berkelium plugin: rendering interactive websites
http://github.com/jdierckx/UnityBerkeliumPlugin
http://forum.unity3d.com/viewtopic.php?t=57298

HtmlTexturePlugin
http://www.unifycommunity.com/wiki/index.php?title=HtmlTexturePlugin

UnityAr ArToolkit Webcam
http://produktion.weltenbauer.com/#/5
http://forum.unity3d.com/viewtopic.php?t=32669

Unity Automatic PDF Gereration with Sharp PDF
http://www.francescogallorini.com/2011/02/unity-sharp-pdf
http://forum.unity3d.com/threads/78108-Runtime-PDF-Gereration

Unity 3 Tree Creation and Editing Video
http://hometime.net/tree edit/tree edit.html
http://forum.unity3d.com/viewtopic.php?t=60094

Runtime obj importer
http://forum.unity3d.com/viewtopic.php?t=45990

M2HPatcher – Patch/update your games
http://forum.unity3d.com/threads/62326-M2HPatcher

Unity 3D Save Tool
http://bladestudios.x10hosting.com/u3dst.html

EZ Replay Manager
http://www.softrare.eu/ez-replay-manager-demo-1.html
http://u3d.as/content/soft-rare/ez-replay-manager

ColdScene – SceneXML
http://forum.unity3d.com/threads/68080

Unity 3 iPhone Plugins
http://www.prime31.com/unity/

Unity3dx
http://www.unity3dx.com

UniTool – Advanced Unity embedding and Flash Interfacing
http://code.google.com/p/unitool
http://forum.unity3d.com/threads/70550

Unity WordPress Blog Plugin

http://unity3d.com/support/resources/assets/unity-wordpress-blog-plugin

Unity WordPress Plugin with Duplicates Fix
http://forum.unity3d.com/threads/38181
http://pennymo.com/2009/09/04/putting-unity-3d-into-wordpress-a-nice-solution

Unity 3.4 unsupported 64-bit Windows web player
http://blogs.unity3d.com/2011/07/28/unity-3-4-web-player-for-64-bit-windows



Read more: http://danim.tv/blog/archives/unity3d-tools/#ixzz2IIH4Xnda

반응형
Posted by blueasa
, |

At first, sorry for my english. My teachers were Japanese
:lol:

As it is known, combining of the objects using one material in one mesh, strongly raises productivity. For this purpose in Standard Assets Unity there is script Combine Children (further: the Combine)
In the course of my work, some additives to a standard script of the Combine were created. And I share it:



[V] Frame To Wait: how many frames on script start to wait before to make combining.
For example, you have an object containing one hundred more other objects which too contain childs. Prefab of internal objects, it is equipped by the Combine with own customisations. On start, all of them will be combined and we will receive less meshes, but all the same a heap. Why not to Combine them again?
We put "1" in this setting and in a following frame, after end childs is combined, we stick together new received meshes again and it is received 5 - 10 meshes instead of old hundreds.
[V] Combine On Start - the script will work on composition start (if it is activated, sure).
[V] Destroy After Optimized - to kill all initial objects. Cautiously! If on these objects have colliders, they too are deleted.
[V] Cast Shadow - created mesh will cast shadow.
[V] Receive Shadow - created mesh will accept shadow.
[V] Keep Layer - the created object will save the same layer, as for the initial object (on which the script is)



Well and, a bonus!
[V] Under the right button there lives Combine Now command. That allows to spend all combination directly in the Editor, to estimate changes and, or to cancel them, or to save in the Scene. That is - to avoid necessity combining on application start.




combinechildren_962.cs



출처 : http://forum.unity3d.com/threads/37721-Combine-Children-Extented-(sources-to-share)

반응형

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

ObjectPool  (0) 2014.04.22
인스펙터 상의 GUI를 비활성화 시키고 싶을 때..  (0) 2014.04.02
Save Scene while on play mode  (0) 2014.01.12
Auto-Save Scene on Run  (0) 2014.01.12
SpriteManager  (0) 2012.11.24
Posted by blueasa
, |

코딩하다가 (개인적으로는) 재미있는 걸 발견해서 올립니다.


직접보시는 게 이해하기 편할 것 같아서..아래 두 이미지를 보시면..





유니티에서 헝가리안과 카멜 표기법 중 뭘 쓰는 게 더 편하냐..라는 뻘 고민을 열심히 하다가..


'm_' 를 넣어봤는데 인스펙터에서 'm_'를 알아서 컬링해 주네요.


그래서 몇 가지 넣어서 테스트 해봤는데..


결론적으로 '_', 'm_' 두 가지만 알아서 컬링을 해 주네요.


이상.. 뻘팁 입니다..;

반응형
Posted by blueasa
, |

Player Settings

Unity3D / 2013. 1. 15. 14:30

유니티는 빌드 타겟(웹플레이어, 아이폰, 안드로이드 등등) 에 따른 각각의 플레이어 셋팅이 있다.

각각 디바이스 환경에 따라 최적화 및 여러 요소가 달라지기 때문이다.

우선 중요한 사항들 몇몇가지만 알아보도록 하자.

  Api Compatibility Level 

.NET 에서 지원해주는 Library 를 어느정도 사용할지에 대한 설정이다.
혹시 데스크탑에서는 잘 돌아가는 프로젝트가 아이폰이나 안드로이드에서 작동하지 않는다면
이 설정을   .Net 2.0 Subset 에서  .Net 2.0 으로  바꾸어 보길.

이 설정에 따른 장단점은
   .Net 2.0 의 경우 거의 모든 .Net 2.0 Library 가 다 들어가지만
1. 어플리케이션 전체의 용량이 증가한다.
2. 초기 실행 시간이 살짝 느려질 수 있다.





반응형

'Unity3D' 카테고리의 다른 글

Sorting Layer 사용하기  (0) 2015.07.20
Layer  (0) 2013.01.15
간단한 Nav Mesh 예제  (0) 2012.11.21
런타임 중 텍스쳐 교체  (0) 2012.11.20
상체 애니메이션 덧붙이기(AddMixingTransform)  (2) 2012.11.16
Posted by blueasa
, |

Layer

Unity3D / 2013. 1. 15. 14:27

유니티에서는 Layer 관리를 인스펙터 창에서 한다.
기본적으로 Default, Transparent FX, Player 등의 기본 레이어가 있으며
사용자가 추가적으로 생성할 수 있다.

이 레이어들은 Camera, Phisycs 등에서 Mask 형식으로 주로 사용 되어진다.

Camera 에서는 culling 설정을 하여 해당 레이어를 렌더링 해서 화면에 보여줄지 말지를 설정 할 수 있으며
Phisycs 에서는 충돌체크시에 해당 레이어의 Collider 들을 계산할지 말지를 설정 할 수 있다.

ex1)

int layerMask = (-1) - (1 << LayerMask.NameToLayer("Player"));  // Everything에서 Player 레이어만 제외하고 충돌 체크함
Physics.Raycast (transform.position, transform.TransformDirection (Vector3.forward), hit, Mathf.Infinity, layerMask);

ex2)

int layerMask = (-1) - (1 << LayerMask.NameToLayer("Player"));

RaycastHit hit;

Ray ray = Camera.mainCamera.ScreenPointToRay( screenPos ); // screenPos는 화면상 클릭 좌표

bool result = Physics.Raycast( ray, out hit, 10000.0f, layerMask );


마지막 인자로 레이어 마스크 값이 쓰였으며 저기에 해당하는 레이어는 제외하고 충돌 검사를 한다. 

레퍼런스에는 충돌을 제외할 레이어 마스크 값이라고 적혀 있지만, 실제는 충돌 체크할 레이어 마스크를 넣어야 함.



P.s. Everything Layer = -1



반응형

'Unity3D' 카테고리의 다른 글

Sorting Layer 사용하기  (0) 2015.07.20
Player Settings  (0) 2013.01.15
간단한 Nav Mesh 예제  (0) 2012.11.21
런타임 중 텍스쳐 교체  (0) 2012.11.20
상체 애니메이션 덧붙이기(AddMixingTransform)  (2) 2012.11.16
Posted by blueasa
, |

1. MonoBehaviour, ScriptableObject 로 부터 ( 직접 혹은 간접으로 ) 상속 받아야 한다.

     ps. GameObject 에 Attach 하려면 MonoBehavior로 부터 상속받고,

           일반 로직등에 필요한 클래스는 ScriptableObject로 부터 상속 받는다. 

 

2. 클래스 이름과 파일 이름이 일치해야 한다.

 

3. namespace를 사용할 수 없다.

 

4. MonoBehaviour 일 경우, 멤버 변수만 Inspector 에 나타난다.

 

5. MonoBehaviour 일 경우, 생성자를 사용하지 말고,  Awake( 이게 생성자 ), Start 함수를 사용한다.

 

6. ScriptableObject일 경우, MonoBehaviour 상속받은 스크립트에서 인스턴스 생성시 new를 사용하지 말고,ScriptableObject.CreateInstance("클래스명") as 클래스형을 사용한다.

 

7. ScriptableObject일 경우,  인스턴스 생성후에 새로운 객체를 재할당 할 때는, GameObject.DestroyImmediate(인스턴스) 호출하여 메모리를 꼭 해지하고 재할당.

 

8. Corutine은 다른 문법으로 사용된다.

반환형은 IEnumerator를 사용해야 하며, yield ... 를 사용할 때, yield return ... 을 사용한다.

 

using System.Collections;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
    // C# coroutine
    IEnumerator SomeCoroutine () {
    // Wait for one frame
    yield return 0;
   
    // Wait for two seconds
    yield return new WaitForSeconds (2);
}

}



[출처] C# 사용할때 주의할 점|작성자 내영

반응형
Posted by blueasa
, |

Link : http://unity3developer.toolbar.fm/



유니티 개발자용 웹브라우저 툴바가 있어서 링크 해 봅니다.


외국에서 만들어서 영문쪽이긴 하지만 쓰는데 별 불편함은 없는 것 같네요.

관심 있으시거나 심심하신 분들은 한 번 깔아보세요.

주의 : 툴바가 기본 브라우저로 설정 된 브라우저에만 깔리는 것 같으니 툴바를 설치하고 싶으신 브라우저를 기본 브라우저로 셋팅 후, 설치해 주세요.

반응형

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

[링크][화면보호기] 플립형 시계 화면보호기(스크린 세이버, screen saver) 모음  (0) 2019.08.06
Unity3d Document for VS2012/VS2013  (2) 2014.11.10
3D Model Viewer  (0) 2013.01.18
Unity3D Tools  (0) 2013.01.18
UnityVS  (0) 2012.12.23
Posted by blueasa
, |

Hierarchy와 Project에서 트리 구조를 살펴보기 위해서 하나하나 열다가 왜 모두 펴고 접는 메뉴가 없는거지..


하고 이리저리 찾아보니 단축키가 있네요.



(이미지_1)


'이미지_1'에서 보이는 빨간 사각형의 화살표를 Left-Alt를 누른채로 마우스 L-Button을 누르면 아래 '이미지_2'와 같이 모두 펴기/접기 토글이 됩니다.


단축키 : L-Alt + L-Button Toggle


(이미지_2)


Project의 스샷만 있습니다만, Hierarchy도 잘 되는걸 확인했습니다.

반응형
Posted by blueasa
, |