GameDev.lv forums

Latviešu spēļu izstrādātāju forums
It is currently 24 Oct 2017, 14:19

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: 21 Sep 2017, 03:41 
Offline

Joined: 16 Sep 2017, 04:27
Posts: 5
ja kaddam nav slinkums palidzat ar unity skriptu ..tas ir vienigais ko man vaig ..pectam es vinu uz visam kermena daljam spamoshu ..atradu neta re ku links kur atradu http://answers.unity3d.com/questions/477281/reverse-animation.html
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:
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;
      }
   }


Top
 Profile  
 
PostPosted: 21 Sep 2017, 03:57 
Offline

Joined: 16 Sep 2017, 04:27
Posts: 5
errori
Assets/scripts/test.cs(9,14): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
Assets/scripts/test.cs(9,24): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
Assets/scripts/test.cs(10,11): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
Assets/scripts/test.cs(10,26): error CS1519: Unexpected symbol `;' in class, struct, or interface member declaration
Assets/scripts/test.cs(12,9): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
Assets/scripts/test.cs(12,18): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
Assets/scripts/test.cs(13,9): error CS1519: Unexpected symbol `:' in class, struct, or interface member declaration
Assets/scripts/test.cs(13,18): error CS1519: Unexpected symbol `=' in class, struct, or interface member declaration
Assets/scripts/test.cs(21,2): error CS9010: Primary constructor body is not allowed
Assets/scripts/test.cs(61,246): error CS1525: Unexpected symbol `end-of-file'


Top
 Profile  
 
PostPosted: 21 Sep 2017, 06:09 
Offline

Joined: 16 Sep 2017, 04:27
Posts: 5
ok ka jau teicu esmu noobs ..bet man pieleca ka skriptiem parada errorus tiesi tur kur ir skripta teikuma ..ha ..neesmu pilnigi bezcerigs ..bet tikunta man ir 1 errors
Assets/scripts/test.cs(59,247): error CS1525: Unexpected symbol `end-of-file'
un re kur izlabota versija
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class test : MonoBehaviour {

   public Animator anim;

   var LEFTKNEE=Transform;
   var test1=AnimationState;

   var B1Aboolean = false;
   var B1Bboolean = false;

   // Use this for initialization
   void Start ()
   {
      anim = GetComponent<Animator> ();
      test1 = LEFTKNEE.anim["LEFTKNEE"];
      LEFTKNEE.anim["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");
         LEFTKNEE.speed = 1;
         LEFTKNEE.anim.Play("LEFTKNEE");
         if (LEFTKNEE.time < 0){
            LEFTKNEE.time = 0;
         }
      }
      if(B1B){
         Debug.Log("B1A = True");
         LEFTKNEE.speed = -1;
         LEFTKNEE.anim.Play("LEFTKNEE");
         if (LEFTKNEE.time > 1){
            LEFTKNEE.time = 1;
         }
      }
      if(!B1A && !B1B){
         LEFTKNEE.speed = 0;
      }
   }

..edit
ne ..parlasiju erroru nozimes ..sapratu ka man erroru nav jo skriptus izsledzu ...tauta kas var palidzet?


Top
 Profile  
 
PostPosted: 21 Sep 2017, 09:14 
Offline

Joined: 06 Mar 2017, 13:18
Posts: 9
laikam trukst pedejas '}' beigas , lai klassi aizvert. (ja pareizi nokopeji visu)


Top
 Profile  
 
PostPosted: 21 Sep 2017, 10:30 
Offline

Joined: 16 Sep 2017, 04:27
Posts: 5
@Holybreath ..nee es vsp mudiitis esmu ..es tagat ilgi mekleju kas pa vainu ..es javaskriptu caur c# sadrukaju :D tagat vai nu japardruka uz c# ..
var B1A:boolean = false;
var B1B:boolean = false;
uz kauko
public bool B1A =false
....utt
vai ari ar javu jatiek gala ..ka jau teicu esmu nuubs pilnigs ..bet man shito skriptu dabut gatavu vaig ..lai varetu charu lidzigi ka QWOP vadit ..parejais man nav tik smags


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group