کانال تخصصی یونیتی ( آموزش و نکته )
前往频道在 Telegram
به نام خدا مسئولیت مطالب یا آگهی ارسالی در کانال یا کامنت ها به عهده من یا ما نیست لیست گروه ها و... https://t.me/UnityEngine3D/823 برای تبلیغ در کانال و گروه : https://t.me/UnityEngine3DAds مدیر اصلی(مالک) @UnityEngine
显示更多1 764
订阅者
-124 小时
+77 天
+1930 天
帖子存档
مدل سه بعدی نارنجک آلمانی به همراه تکسچر کامل
لینک دانلود👇
http://opizo.com/H0y3Jz
#مدل
@UnityEngine
دانلود آخرین نسخه یونیتی
نسخه 2018.1.6f1
https://dl2.soft98.ir/adobe/Unity.3D.Pro.2018.1.6f1.x64.rar?1530939383
____________________________
دانلود addons
http://dl.downloadly.ir/Files/Software2/Unity_Pro_2018.1.6f1_addons_Downloadly.ir.rar
دوستان فعلا هیچگونه مادلی در سایت های ایرانی پیدا نشد
میتوانید وقتی یونیتی رو کرک کردید برید از خود سایت یونیتی با فیلتر شکن مادل مورد نظرتون رو دانلود کنید
#یونیتی
@UnityEngine
برای اینکه بتونیم از این کد ها استفاده کنیم ابتدا باید دوتا شی ایجاد کنیم . مثلا دو مکعب ایجاد می کنیم به نام Enemy و Player.
حالا یک فایل سی شارپ با نام EnemyAI ایجاد می کنیم ( توجه کنید که حتما اسمش این باشه ). کد زیر رو توش کپی می کنیم.
کد:
using UnityEngine;
using System.Collections;
public class EnemyAI : MonoBehaviour {
public Transform target;
public int moveSpeed;
public int rotationSpeed;
public int maxdistance;
private Transform myTransform;
void Awake(){
myTransform = transform;
}
void Start () {
GameObject go = GameObject.FindGameObjectWithTag("Player");
target = go.transform;
maxdistance = 2;
}
void Update () {
Debug.DrawLine(target.position, myTransform.position, Color.red);
myTransform.rotation = Quaternion.Slerp(myTransform.rotation, Quaternion.LookRotation(target.position - myTransform.position), rotationSpeed * Time.deltaTime);
if(Vector3.Distance(target.position, myTransform.position) > maxdistance){
//Move towards target
myTransform.position += myTransform.forward * moveSpeed * Time.deltaTime;
}
}
}
فایل رو سیو می کنیم و به شی Enemy مرتبطش می کنیم و شی Player رو به عنوان هدف بهش معرفی کرده و مقادیر سرعت حرکت سرعت چرخش و میزان فاصلشو با شی مورد نظر مشخص می کنیم.
@UnityEngine
خب حالا یک فایل C# دیگه با نام PlayerHealth ساخته و کد زیر رو درش کپی می کنیم.
کد:
using UnityEngine;using System.Collections;
public class PlayerHealth : MonoBehaviour {
public int maxHealth = 100;
public int curHealth = 100;
public float healthBarLength;
void Start () {
healthBarLength = Screen.width / 2;
}
void Update () {
AddjustCurrentHealth(0);
}
void OnGUI(){
GUI.Box(new Rect(10, 10, healthBarLength, 20), curHealth + "/" + maxHealth);
}
public void AddjustCurrentHealth(int adj) {
curHealth += adj;
if(curHealth < 0)
curHealth = 0;
if(curHealth > maxHealth)
curHealth = maxHealth;
if(maxHealth < 1)
maxHealth = 1;
healthBarLength = (Screen.width / 2) * (curHealth / (float)maxHealth);
}
}
حال فایل رو سیو می کنیم و به شی Player متصلش می کنیم و میزان سقف خون ، میزان خون حال حاضر و طول میزان خونی که در صفحه نمایش نمایش داده میشه که البته نیازی به تعیین این نیست و خودش اتوماتیک تعیین میشه.
خب حالا نوبت به حمله دشمن میرسه . یک فایل با نام EnemyAttack می سازیم و کد زیر رو درش کپی می کنیم.
کد:
using UnityEngine;using System.Collections;
public class EnemyAttack : MonoBehaviour {
public GameObject target;
public float attackTime;
public float coolDown;
void Start () {
attackTime = 0;
coolDown = 2.0f;
}
void Update () {
if(attackTime > 0)
attackTime -= Time.deltaTime;
if(attackTime < 0)
attackTime = 0;
if(attackTime == 0) {
Attack();
attackTime = coolDown;
}
}
private void Attack() {
float distance = Vector3.Distance(target.transform.position, transform.position);
Vector3 dir = (target.transform.position - transform.position).normalized;
float direction = Vector3.Dot(dir, transform.forward);
if(distance < 2.5f) {
if(direction > 0) {
PlayerHealth eh = (PlayerHealth)target.GetComponent("PlayerHealth");
eh.AddjustCurrentHealth(-10);
}
}
}
}
بعد از اینکار فایل رو ذخیره کرده و به شی دشمن نسبت میدیم و شی هدف که همون Player هست رو بهش معرفی کرده و مقدار زمان حمله و زمان آماده سازی رو براش تعیین می کنیم.
حالا بازی رو اجرا می کنیم و میبینیم که به دنبال پلیر میفته تا نگیردشم ول کن نیستش.
@UnityEngine
#یونیتی
آموزش ویدیویی پکیج Final IK👇
http://dl.kelidestan.com/assets/assets-000004/kelidestan.com_0001473152752s1C45Rm3fLGnocIik81up2IcuSn9T77ytJv7AbF53ra9eZ6xYM5.mp4
_______________________________ __
دانلود پکیج Final IK نسخه بتا👇
http://dl.kelidestan.com/assets/assets-000004/kelidestan.com_0001473153123wBRcFGKnrkr3vhgIWK5imsfhQBAEZVrRTDFS9rBaQA5IzLsYrdA.zip
#یونیتی
@UnityEngine
پکیج Final IK
برای راه رفتن طبیعی در یونیتی
در پست بعدی👇👇
#یونیتی
@UnityEngine
پکیج Easy traffic در یونیتی
دانلود مستقیم در سرور مدیا فایر👇👇
http://www.mediafire.com/download/p6363sb4icnwmf4/Easy_Traffic_%28prolearning.ir%29.rar
#یونیتی
@UnityEngine
دانلود پکیج بسیار قدرتمند Super Mario
http://opizo.com/iR27GY
#یونیتی
@UnityEngine
#یونیتی
مدل کم حجم پایگاه نظامی . مخصوص بازی های اندروید ... دانلود : http://opizo.com/ofqeN6
@UnityEngine
#یونیتی
دانلود پکیج تخریب اجسام در یونیتی
( Fracturing & Destruction )
@UnityEngine
现已上线!2025 年 Telegram 研究 — 年度关键洞察 
