Скрипт прицела - Форум Игроделов
Сб, 19 Июл 2025, 23:56 
 
Приветствую Вас Гость Главная | Регистрация | Вход
Новые сообщения · Участники · Правила форума · Поиск · RSS ]
  • Страница 1 из 1
  • 1
Скрипт прицела
MrKyzminДата: Пт, 21 Сен 2012, 19:22 | Сообщение # 1
 
Сообщений: 70
Награды: 0
Репутация: 1
Статус: Offline
Вот решил выложить скрипт прицела от бедра:

Code

using UnityEngine;
using System.Collections;

public class Crosshair : MonoBehaviour {
   
  public Texture2D crosshairTexture;
  Rect position;
   
  // Use this for initialization
  void Start (){  
   
  position = new Rect(( Screen.width - crosshairTexture.width)/2,(Screen.height - crosshairTexture.height)/2,
    crosshairTexture.width, crosshairTexture.height);

}

// Update is called once per frame
void OnGUI (){

GUI.DrawTexture(position, crosshairTexture);
    
  }
}


Кинут этот скрипт на Empty объект на сцене и вставить ваш прицел в CrossHair Texture


/人◕ ‿‿ ◕人\

Если помог не поленитесь и поставьте +
 
СообщениеВот решил выложить скрипт прицела от бедра:

Code

using UnityEngine;
using System.Collections;

public class Crosshair : MonoBehaviour {
   
  public Texture2D crosshairTexture;
  Rect position;
   
  // Use this for initialization
  void Start (){  
   
  position = new Rect(( Screen.width - crosshairTexture.width)/2,(Screen.height - crosshairTexture.height)/2,
    crosshairTexture.width, crosshairTexture.height);

}

// Update is called once per frame
void OnGUI (){

GUI.DrawTexture(position, crosshairTexture);
    
  }
}


Кинут этот скрипт на Empty объект на сцене и вставить ваш прицел в CrossHair Texture

Автор - MrKyzmin
Дата добавления - 21 Сен 2012 в 19:22
  • Страница 1 из 1
  • 1
Поиск:
Загрузка...

Game Creating CommUnity © 2009 - 2025