C# Unity assebmly referance hatası

smokex

Femtopat
Katılım
17 Mart 2021
Mesajlar
9
Daha fazla  
Cinsiyet
Erkek
Assets\ThirdPersonInput.cs(11,12): error CS0246: The type or namespace name 'button' could not be found (are you missing a using directive or an Assembly reference?)
 

Dosya Ekleri

  • Adsız.png
    34,3 KB · Görüntüleme: 128
Assets\ThirdPersonInput.cs(11,12): error CS0246: The type or namespace name 'button' could not be found (are you missing a using directive or an Assembly reference?)

Buton bulunamadı diyor hocam hata kodun da.
 
Start ya da Awake fonksiyonu içinden ya da direk public yaparak Inspector penceresinden açılan girdiye oyun objesi sürükleyerek istediğiniz butonun referansını eklemeniz gerekli.
 
Start ya da Awake fonksiyonu içinden ya da direk public yaparak Inspector penceresinden açılan girdiye oyun objesi sürükleyerek istediğiniz butonun referansını eklemeniz gerekli.
saten public yazılı
 
O zaman ilgili objenin referansını sürükleyip bırakmanız yeterli. Her şekilde referansını almanız gerekli.
hocam denedimde sürüklenecek yer yok yani kod çalışmadığı için onu göstermiyor
 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityStandardAssets.Characters.ThirdPerson;

public class ThirdPersonInput : MonoBehaviour
{

public FixedJoystick LeftJoystick;
public FixedButton Button;
public FixedTouchField TouchField;
protected ThirdPersonUserControl Control;

protected float CameraAngle;
protected float CameraAngleSpeed = 0.2f;

// Use this for initialization
void Start()
{
Control = GetComponent<ThirdPersonUserControl>();
}
}

// Update is called once per frame
void Update()
{
Control.m_Jump = Button.Pressed;
Control.Hinput = LeftJoystick.inputVector.x;
Control.Vinput = LeftJoystick.inputVector.y;

CameraAngle += TouchField.TouchDist.x * CameraAngleSpeed;

Camera.main.transform.position = transform.position + Quaternion.AngleAxis(CameraAngle, Vector3.up) * new Vector3(0, 3, 4);
Camera.main.transform.rotation = Quaternion.LookRotation(transform.position + Vector3.up * 2f - Camera.main.transform.position, Vector3.up);

}
}
 
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…