PDA

View Full Version : طراحی بازی با یونیتی؟



mohamad_torabi
شنبه 22 شهریور 1393, 22:59 عصر
با سلام
چند وقته به سرم زده برم سمت اندروید و طراحیه بازی :لبخند:
یه نفر گفت با یونیتی شروع کن
سوالام ایناست :
یونیتی چی هست و پیش نیازی داره ؟
این فیلم اموزشیه یونیتی که این سایت قرار میده خروجیش برای ویندوز هست یا اندروید ؟
http://cgcapture.com/?p=51
یونیتی مرجع فارسیه دیگه ای داره که یادبگیرم ؟
کلا اصلا باید یونیتی رو یاد بگیرم ؟ و اگر اره چطوری ؟

abbasalim
شنبه 22 شهریور 1393, 23:58 عصر
سلام
یونیتی به نظرم خیلی خوبه ولی برای بازی های 2 بعدی به شخصه پیشنهاد نمیکنم چون حجمشون بالا میره
برای بازی های 3 بعدی خوبه البته رو گوشی های ضعیف بازیهاش اجرا نمیشه armv7 حتما باد باشه ولی در کل خوبه
برای برنامه نویسی منتظر منابع فارسی نباید بایستی

ساخت بازی برای اندروید یا پلتفرم های دیگه زیاد تو مراحل ساخت تفاوتی نداره فقط برای کارهای جنبی مثل صفحه کلید لمس سنسور و همچنین خروجی گرفتن تفاوت اصلی هست وگرنه کد زنی واردسازی مدل ها و چیزهای دیگش یکیه

mohamad_torabi
یک شنبه 23 شهریور 1393, 00:28 صبح
سلام
یونیتی به نظرم خیلی خوبه ولی برای بازی های 2 بعدی به شخصه پیشنهاد نمیکنم چون حجمشون بالا میره
برای بازی های 3 بعدی خوبه البته رو گوشی های ضعیف بازیهاش اجرا نمیشه armv7 حتما باد باشه ولی در کل خوبه
برای برنامه نویسی منتظر منابع فارسی نباید بایستی

ساخت بازی برای اندروید یا پلتفرم های دیگه زیاد تو مراحل ساخت تفاوتی نداره فقط برای کارهای جنبی مثل صفحه کلید لمس سنسور و همچنین خروجی گرفتن تفاوت اصلی هست وگرنه کد زنی واردسازی مدل ها و چیزهای دیگش یکیه
ممنون از اینکه پاسخ دادین اموزش فارسی برای مقدمات کار وجود نداره تا یادبگیرم ؟ اموزشی که دادم خروجیش اندروید خواهد بود ؟

dasssnj
یک شنبه 23 شهریور 1393, 05:01 صبح
ممنون از اینکه پاسخ دادین اموزش فارسی برای مقدمات کار وجود نداره تا یادبگیرم ؟ اموزشی که دادم خروجیش اندروید خواهد بود ؟

من هم چند وقته همون آموزش هایی که گفتید را پیگیری می کنم . از مقدمات کار هم شروع کرده و خیلی خوب هم توضیح میده.
این فیلم آموزشی قرار است در قسمت 10 و 11 به خروجی ویندوز و اندروید به صورت جدا بپردازد.
ابن موتور 20 درصد فقط کد نویسی داره و بقیه ش با ابزار های خود یونیتی و با موس انجام میگیره.
من که دارم یاد میگیرم راضیم شما را نمی دونم . در کل خوبه اما من andengine را هم چون جاوا کار می کنم دوست دارم.

این لینک لیست آموزش ها هست که فعلا 8 تاش اومده قراره 3 تا دیگه هم ان شا الله تا هفته های آینده بیاد.
http://cgcapture.com/?cat=18

mohamad_torabi
یک شنبه 23 شهریور 1393, 12:26 عصر
من هم چند وقته همون آموزش هایی که گفتید را پیگیری می کنم . از مقدمات کار هم شروع کرده و خیلی خوب هم توضیح میده.
این فیلم آموزشی قرار است در قسمت 10 و 11 به خروجی ویندوز و اندروید به صورت جدا بپردازد.
ابن موتور 20 درصد فقط کد نویسی داره و بقیه ش با ابزار های خود یونیتی و با موس انجام میگیره.
من که دارم یاد میگیرم راضیم شما را نمی دونم . در کل خوبه اما من andengine را هم چون جاوا کار می کنم دوست دارم.

این لینک لیست آموزش ها هست که فعلا 8 تاش اومده قراره 3 تا دیگه هم ان شا الله تا هفته های آینده بیاد.
http://cgcapture.com/?cat=18
ممنون از شما دوست عزیز
این اموزش خوبه که از صفر توضیح میده ولی با جاوا اسکریپت کار میکنه که من با سی شارپ رو دوست دارم باهاش کار کنم

dasssnj
یک شنبه 23 شهریور 1393, 13:22 عصر
ممنون از شما دوست عزیز
این اموزش خوبه که از صفر توضیح میده ولی با جاوا اسکریپت کار میکنه که من با سی شارپ رو دوست دارم باهاش کار کنم

منم اول با سی شارپ شروع کردم و فکر می کردم بهتره ولی حالا که اومدم سراغ جاوا اسکریپت میبینم هم کد زدن باهاش آسونتره و هم جذاب تره و اینکه دیگه بهش نمیشه گفت جاوا اسکریت چون خیلی تغییرات توش توسط یونیتی به وجود اومده که بهش میگن یونیتی اسکریپت .

البته تفاوت های زیادی با سی شارپ نداره . شما اگه یونیتی اسکریپت یاد گرفتید به راحتی می تونید کد هاشو به سی شارپ تبدیل کنید یعنی کد هایی که به صورت یونیتی اسکریپت یاد گرفتید را به راحتی می تونید به سی شارپ باز نویسی کنید .

من از هر کدوم یه نمونه کد می ذارم شما مقایسه کن (مال زوم دو انگشتیه).

جاوا اسکریپت (یونیتی اسکریپت) :


#pragma strict

public var perspectiveZoomSpeed : float = 0.5f; // The rate of change of the field of view in perspective mode.
public var orthoZoomSpeed : float = 0.5f; // The rate of change of the orthographic size in orthographic mode.


function Update()
{
// If there are two touches on the device...
if (Input.touchCount == 2)
{
// Store both touches.
var touchZero = Input.GetTouch(0);
var touchOne = Input.GetTouch(1);

// Find the position in the previous frame of each touch.
var touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
var touchOnePrevPos = touchOne.position - touchOne.deltaPosition;

// Find the magnitude of the vector (the distance) between the touches in each frame.
var prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
var touchDeltaMag = (touchZero.position - touchOne.position).magnitude;

// Find the difference in the distances between each frame.
var deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;

// If the camera is orthographic...
if (camera.isOrthoGraphic)
{
// ... change the orthographic size based on the change in distance between the touches.
camera.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;

// Make sure the orthographic size never drops below zero.
camera.orthographicSize = Mathf.Max(camera.orthographicSize, 0.1f);
}
else
{
// Otherwise change the field of view based on the change in distance between the touches.
camera.fieldOfView += deltaMagnitudeDiff * perspectiveZoomSpeed;

// Clamp the field of view to make sure it's between 0 and 180.
camera.fieldOfView = Mathf.Clamp(camera.fieldOfView, 0.1f, 179.9f);
}
}
}


سی شارپ :

using UnityEngine;

public class PinchZoom : MonoBehaviour
{
public float perspectiveZoomSpeed = 0.5f; // The rate of change of the field of view in perspective mode.
public float orthoZoomSpeed = 0.5f; // The rate of change of the orthographic size in orthographic mode.


void Update()
{
// If there are two touches on the device...
if (Input.touchCount == 2)
{
// Store both touches.
Touch touchZero = Input.GetTouch(0);
Touch touchOne = Input.GetTouch(1);

// Find the position in the previous frame of each touch.
Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;

// Find the magnitude of the vector (the distance) between the touches in each frame.
float prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;

// Find the difference in the distances between each frame.
float deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;

// If the camera is orthographic...
if (camera.isOrthoGraphic)
{
// ... change the orthographic size based on the change in distance between the touches.
camera.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;

// Make sure the orthographic size never drops below zero.
camera.orthographicSize = Mathf.Max(camera.orthographicSize, 0.1f);
}
else
{
// Otherwise change the field of view based on the change in distance between the touches.
camera.fieldOfView += deltaMagnitudeDiff * perspectiveZoomSpeed;

// Clamp the field of view to make sure it's between 0 and 180.
camera.fieldOfView = Mathf.Clamp(camera.fieldOfView, 0.1f, 179.9f);
}
}
}
}

mohamad_torabi
یک شنبه 23 شهریور 1393, 13:34 عصر
منم اول با سی شارپ شروع کردم و فکر می کردم بهتره ولی حالا که اومدم سراغ جاوا اسکریپت میبینم هم کد زدن باهاش آسونتره و هم جذاب تره و اینکه دیگه بهش نمیشه گفت جاوا اسکریت چون خیلی تغییرات توش توسط یونیتی به وجود اومده که بهش میگن یونیتی اسکریپت .

البته تفاوت های زیادی با سی شارپ نداره . شما اگه یونیتی اسکریپت یاد گرفتید به راحتی می تونید کد هاشو به سی شارپ تبدیل کنید یعنی کد هایی که به صورت یونیتی اسکریپت یاد گرفتید را به راحتی می تونید به سی شارپ باز نویسی کنید .

من از هر کدوم یه نمونه کد می ذارم شما مقایسه کن (مال زوم دو انگشتیه).

جاوا اسکریپت (یونیتی اسکریپت) :


#pragma strict

public var perspectiveZoomSpeed : float = 0.5f; // The rate of change of the field of view in perspective mode.
public var orthoZoomSpeed : float = 0.5f; // The rate of change of the orthographic size in orthographic mode.


function Update()
{
// If there are two touches on the device...
if (Input.touchCount == 2)
{
// Store both touches.
var touchZero = Input.GetTouch(0);
var touchOne = Input.GetTouch(1);

// Find the position in the previous frame of each touch.
var touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
var touchOnePrevPos = touchOne.position - touchOne.deltaPosition;

// Find the magnitude of the vector (the distance) between the touches in each frame.
var prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
var touchDeltaMag = (touchZero.position - touchOne.position).magnitude;

// Find the difference in the distances between each frame.
var deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;

// If the camera is orthographic...
if (camera.isOrthoGraphic)
{
// ... change the orthographic size based on the change in distance between the touches.
camera.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;

// Make sure the orthographic size never drops below zero.
camera.orthographicSize = Mathf.Max(camera.orthographicSize, 0.1f);
}
else
{
// Otherwise change the field of view based on the change in distance between the touches.
camera.fieldOfView += deltaMagnitudeDiff * perspectiveZoomSpeed;

// Clamp the field of view to make sure it's between 0 and 180.
camera.fieldOfView = Mathf.Clamp(camera.fieldOfView, 0.1f, 179.9f);
}
}
}


سی شارپ :

using UnityEngine;

public class PinchZoom : MonoBehaviour
{
public float perspectiveZoomSpeed = 0.5f; // The rate of change of the field of view in perspective mode.
public float orthoZoomSpeed = 0.5f; // The rate of change of the orthographic size in orthographic mode.


void Update()
{
// If there are two touches on the device...
if (Input.touchCount == 2)
{
// Store both touches.
Touch touchZero = Input.GetTouch(0);
Touch touchOne = Input.GetTouch(1);

// Find the position in the previous frame of each touch.
Vector2 touchZeroPrevPos = touchZero.position - touchZero.deltaPosition;
Vector2 touchOnePrevPos = touchOne.position - touchOne.deltaPosition;

// Find the magnitude of the vector (the distance) between the touches in each frame.
float prevTouchDeltaMag = (touchZeroPrevPos - touchOnePrevPos).magnitude;
float touchDeltaMag = (touchZero.position - touchOne.position).magnitude;

// Find the difference in the distances between each frame.
float deltaMagnitudeDiff = prevTouchDeltaMag - touchDeltaMag;

// If the camera is orthographic...
if (camera.isOrthoGraphic)
{
// ... change the orthographic size based on the change in distance between the touches.
camera.orthographicSize += deltaMagnitudeDiff * orthoZoomSpeed;

// Make sure the orthographic size never drops below zero.
camera.orthographicSize = Mathf.Max(camera.orthographicSize, 0.1f);
}
else
{
// Otherwise change the field of view based on the change in distance between the touches.
camera.fieldOfView += deltaMagnitudeDiff * perspectiveZoomSpeed;

// Clamp the field of view to make sure it's between 0 and 180.
camera.fieldOfView = Mathf.Clamp(camera.fieldOfView, 0.1f, 179.9f);
}
}
}
}


بله ظاهرا که یکی هستند پس با همون یونیتی اسکپریت شروع کنم خوب هست ؟

dasssnj
یک شنبه 23 شهریور 1393, 14:15 عصر
بله ظاهرا که یکی هستند پس با همون یونیتی اسکپریت شروع کنم خوب هست ؟

بله خوبه . یه سری تفاوت های کوچک هست که به مرور زمان عادی میشه .
امیدوارم توی این راه موفق باشید .