Показать сообщение отдельно
Старый 29.01.2013, 22:51   #2
mepihin
ПроЭктировщик
 
Регистрация: 31.12.2012
Сообщений: 165
Написано 5 полезных сообщений
(для 7 пользователей)
Ответ: Сглаживание перехода между сценами

Попробовал твою систему, сделал как все ты говорил, создал плейн, текстуру на него и скрипт, сохранил его префаб и удалил со сцены, в свой скрипт Health вставляю:
using UnityEngine;
using System.Collections;

public class 
Health MonoBehaviour {
    
    public 
int health 80;
    private 
int maxHealth 80;
    
    
void OnGUI()
    {
        
GUI.Box(new Rect(10,Screen.height-55,150,20),"");
        
GUI.Label(new Rect(25,Screen.height-55,150,20),"Health: " maxHealth " / " health);
        
        if(
health >= maxHealthhealth maxHealth;
        if(
health <= 0)
        {
            
health 0;
            
transitPlane=(GameObject)Instantiate(TransitPlane);
            
transitPlane.GetComponent<LevelChange>().LevelNumber "Scene2";
    
    } 
Пишет ошибки:
The name `TransitPlane' does not exist in the current context
The best overloaded method match for `UnityEngine.Object.Instantiate(UnityEngine.Object )' has some invalid arguments
The best overloaded method match for `UnityEngine.Object.Instantiate(UnityEngine.Object )' has some invalid arguments

The name `transitPlane' does not exist in the current context

The name `transitPlane' does not exist in the current context
(Offline)
 
Ответить с цитированием