Unity 3D TR Forum

Orjinalini görmek için tıklayınız: Unity CS1525 hatası alıyorum
Şu anda (Arşiv) modunu görüntülemektesiniz. Orjinal Sürümü Görüntüle internal link
Merhaba ben unity için bir kod yazdım fakat bu kodda şöyle bir hata alıyorum: Assets/Enemy.cs(38,7): error CS1525: Unexpected symbol `float', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
Kod:
using System.Runtime.InteropServices;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;

public float miny = 13.1;
public float maxy = 15.5f;
public float speed = 0.05f;
public float kaybol = -25.0f;
public Transform Body;
private rg;

public class Enemy : MonoBeheaviour {

    void move(){

        Body.position.z -= speed;

    }

    void Update(){

        rg = Random.Range(miny, maxy);

        Body.position.y = rg;

        while(Body.position.z > kaybol){

            Invoke("move",2.0f);

            //Body.position.z -= speed;

        }

    }

}
Kod:
public float miny = 13.1;
public float maxy = 15.5f;
public float speed = 0.05f;
public float kaybol = -25.0f;
public Transform Body;
private rg;

Bu kısmı aşağıdaki satırdan sonra yazmalısın.

Kod:
public class Enemy : MonoBeheaviour {