小编Nur*_*lah的帖子

如何使用Unity Toggle Check Function(选中和未选中)

我正在尝试切换。当我点击切换按钮(如果它处于打开状态,我是指选中的)时,它会关闭一些游戏对象;如果我点击切换按钮(如果它处于关闭状态,我是指未选中的),它会打开一些游戏对象,但是我不知道哪个功能是统一的 toggle.onselecttoggle.onValuesChanged?或其他

public GameObject controlledObject;
public NamesGet nameController;
public Text text;
public Button button;
public Toggle toggle;
private bool deneme;
public void FixedUpdate()
{
    text.text = controlledObject.name;

    if(?????????)
    {
        controlledObject.SetActive(!controlledObject.activeSelf);

    }
}
Run Code Online (Sandbox Code Playgroud)

c# toggle oncheckedchanged unity-game-engine

1
推荐指数
1
解决办法
2万
查看次数

错误:无法使用'void'类型的左值初始化'int'类型的变量

我正在尝试pthread示例.这是我的代码:

#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>

void*AsalK1(void *gelen);

int main(){

    int *i;
    i= new int;
    *i=1;

    int sonSayi;
    pthread_t th1, th2, th3, th4;
    printf("---------------------------------------------\n");
    printf("|       Threadler ile Asal Sayi Bulma       |\n");
    printf("---------------------------------------------\n");
    printf("Son sayi degeri: 1000000 \n");

    int r1=pthread_create( &th1, NULL, AsalK1, (void *)i);
    *i=3;
    int r2=pthread_create( &th2, NULL, AsalK1, (void *)i);
    *i=5;
    int r3=pthread_create( &th3, NULL, AsalK1, (void *)i);
    *i=7;
    int r4=pthread_create( &th4, NULL, AsalK1, (void *)i);

    pthread_join( th1, NULL);
    pthread_join( th2, NULL);
    pthread_join( th3, NULL);
    pthread_join( th4, NULL);
    return 0; …
Run Code Online (Sandbox Code Playgroud)

c pthreads

0
推荐指数
1
解决办法
1万
查看次数

标签 统计

c ×1

c# ×1

oncheckedchanged ×1

pthreads ×1

toggle ×1

unity-game-engine ×1