https://www.aparat.com/v/8Xs5S, ...ادامه مطلب
gameover.blog.ir این پروژه(در ویژوال استادیو 2012 ساختیم) http://s9.picofile.com/file/8316791092/test.rar.html نویسنده:بیسواد وقتی روی باتن 2 بزنید ، رویداد کلیک باتن 1 اجرا میشه.اینم کد کامل: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace test { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MessageBox.Show(button1.Name); } private void button2_Click(object sender, EventArgs e) { button1_Click(button1, e); } } } نکته: در قسمت button1_Click(button1, e); می تونید به جای e و button1 مقدار null بدید و اونطرف دیگه sender دریافت نمیشه و اسم دکمه و این چیزا قابل دریافت نیست و فقط می تونید توی کلیک باتن 1 مثلا یک پیام رو با MessageBox نمایش بدید. , ...ادامه مطلب
gameover.blog.ir نکته: حتما به اسپرایت باید کلایدر دو بعدی بدید بعدش کد زیر کار می کنه: using System.Collections;using System.Collections.Generic;using UnityEngine;using UnityEngine.UI;using UnityEngine.EventSystems;public class eye_left : MonoBehaviour{ public void OnMouseDown() { Debug.Log("merc"); }}, ...ادامه مطلب
gameover.blog.ir دقت کنید اسکریپت test.cs زیر رو بدید به دوربین اصلی و دوربین رو بکشید روی متغیر mainCam رها کنید و یادتون نرده گیم ابجکت سه بعدی اسپرایت(sprite) دو بعدی شما حتما باید Collider سه بعدی(3d) داشته باشه نه box collider 2d یا ... .به هر , ...ادامه مطلب
gameover.blog.ir مسیر رجیستری: _root | * shell open with notepadcommand, ...ادامه مطلب
gameover.blog.ir using UnityEngine; using UnityEngine.UI; using System.Collections; public class Move : MonoBehaviour { public InputField inputFiled1; public Text label1; public Button btn1; void Start () { //btn1.onClick.AddListener(() btn1.OnPointerDown.AddListener(()=>{ ...... }); } رویدادهای دیگه: OnDeselect Unset selection and transition to appropreate state.OnMove Determine in which of the 4 move directions the next selectable object should be found.OnPointerDown Evaluate current state and transition to pressed state.OnPointerEnter Evaluate current state and transition to appropreate state.OnPointerExit Evaluate current state and transition to normal state.OnPointerUp Evaluate eventData and transition to appropriate state.OnSelect Set selection and transition to appropreate state., ...ادامه مطلب