man vaig tieshi to funkciju ..spiezham pogu animacija spele ..atlaizham apstajas ..spiezham citu pogu animacija spele reversaa
esmu pilnigs nuubs bet man tas ir vienigais kas kave no speles izstrades
re ku tas ko es sacepu .. un sameta 1001 erroru (10 errorus ja precizak)
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class test : MonoBehaviour {
public Animator anim;
var LEFTKNEE:Transform;
var Bend1:AnimationState;
var B1A:boolean = false;
var B1B:boolean = false;
// Use this for initialization
void Start ()
{
anim = GetComponent<Animator> ();
}
{
Bend1 = LEFTKNEE.animation["LEFTKNEE"];
LEFTKNEE.animation["LEFTKNEE"].wrapMode = WrapMode.ClampForever;
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown("down")){
B1A = true;
}
if(Input.GetKeyUp("down")){
B1A = false;
}
if(Input.GetKeyDown("up")){
B1B = true;
}
if(Input.GetKeyUp("up")){
B1B = false;
}
if(B1A){
Debug.Log("B1A = True");
Bend1.speed = 1;
LEFTKNEE.animation.Play("LEFTKNEE");
if (Bend1.time < 0){
Bend1.time = 0;
}
}
if(B1B){
Debug.Log("B1A = True");
Bend1.speed = -1;
LEFTKNEE.animation.Play("LEFTKNEE");
if (Bend1.time > 1){
Bend1.time = 1;
}
}
if(!B1A && !B1B){
Bend1.speed = 0;
}
}