我正在尝试切换。当我点击切换按钮(如果它处于打开状态,我是指选中的)时,它会关闭一些游戏对象;如果我点击切换按钮(如果它处于关闭状态,我是指未选中的),它会打开一些游戏对象,但是我不知道哪个功能是统一的
toggle.onselect?
toggle.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) 我正在尝试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)