Показать сообщение отдельно
Старый 10.05.2013, 19:07   #14
RegIon
Элита
 
Аватар для RegIon
 
Регистрация: 16.01.2010
Адрес: Новосибирск
Сообщений: 2,157
Написано 502 полезных сообщений
(для 1,012 пользователей)
Ответ: "Что случилось?"(RegIon)

Народ, помогите (знаю что не по правилам, но..)
Никак не могу нормально освоить маканим, подскажите как правильно сделать.
Скрипт:

using UnityEngine;
using System.Collections;

public class 
AnimationController MonoBehaviour
{

    public 
Animator anim;
    private 
CharacterMotor motor;
    private 
CharacterController info;
    private 
PlatformInputController pIc;
    private 
StairController stair;
    static 
int idly Animator.StringToHash ("Base Layer.Idly");
    static 
int run Animator.StringToHash ("Base Layer.run");
    static 
int jumpOut Animator.StringToHash ("Base Layer.JumpOut");
    
    
void Awake ()
    {
        
anim GetComponent<Animator> ();
        
motor GetComponent<CharacterMotor> ();
        
info GetComponent<CharacterController> ();
        
pIc GetComponent<PlatformInputController> ();
        
stair GetComponent<StairController> ();
    }
    
    
// Update is called once per frame
    
void Update ()
    {
        
AnimatorStateInfo curState anim.GetCurrentAnimatorStateInfo (0);
        if (
curState.nameHash == idly) {    
            if (
motor.inputJump) {
                
anim.SetBool ("Jump"true);    
            }
        }
        
        if (
curState.nameHash == jumpOut)
            
anim.SetBool ("Jump"false);

        
        
//anim.SetBool ("Move", info.velocity.magnitude > 0.01f && pIc.directionVector.magnitude > 0 && pIc.ground);
        
anim.SetBool ("Move",pIc.directionVector.magnitude && pIc.ground);
        
        
bool flyTrigger=!pIc.ground&&!stair.findStair;
        
//Debug.Log(stair.findStair.ToString()+pIc.ground.ToString()+flyTrigger.ToString());
        
anim.SetBool ("Fly",flyTrigger);
        
Debug.Log(flyTrigger);
        if (!
motor.enabled) {
            
anim.SetBool ("InStair"true);
            
anim.SetFloat ("StairsDir"Input.GetAxis ("Vertical"));
        } else {
            
anim.SetBool ("InStair"false);
            
anim.SetFloat ("StairsDir"0);
        }
            
        
    }


Скрин контроллера:

Название: ScreenShot 57.bmp
Просмотров: 620

Размер: 3.00 Мб

Описание проблемы:
Если прыгнуть около лестницы и нажать кнопку влезания, то анимация иден не по Idly-JumpIn-Stairs, а по Idly-JumpIn-Fly-JumpOut-Idly-Stairs (вроде правильно написал).=(
Веб-версия стала почему-то вылетать из-за меканим, вот WIN:
http://rghost.ru/45897391

--Яро лагать начал, все из-за упоротого CharacterMotor
Скрытый текст (вы должны войти под своим логином или зарегистрироваться и иметь 400 сообщение(ий)):
У вас нет прав, чтобы видеть скрытый текст, содержащийся здесь.
__________________
Сайт: http://iexpo.ml
(Offline)
 
Ответить с цитированием