Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.FindWithTag("Player").GetComponent <Transform>();

        playerinfo = GameObject.FindWithTag("Player").GetComponent <bossplayerinfo>();
        //플레이어의 위치를 조이스틱의 방향으로 이동

        //조이스틱배경의 맨 처음 위치
        Stickback1 = Stickback.transform.position;
        //조이스틱의 맨 처음 위치
        Stick1 = Stick.transform.position;

        //반지름은 배경의 y값의 절반
        Radius = GetComponent <RectTransform>().sizeDelta.y * 0.5f;
        Debug.Log("0 , start");
        Debug.Log("1 , Radius:" + Radius);

        //조이스틱의 원래 위치
        StickFirstPos   = Stick.transform.position;
        StickFirstPos.z = 0;
        Debug.Log("2 , StickFirstPos:" + StickFirstPos);

        // 캔버스 크기에대한 반지름 조절.
        float Can = transform.parent.GetComponent <RectTransform>().localScale.x;

        Debug.Log("3 , Can:" + Can);
        Radius *= Can;
        Debug.Log("4 , Radius:" + Radius);
        MoveFlag = false;

        //플레이어 애니메이션
        anim = GameObject.FindWithTag("Player").GetComponent <Animator>();

        fillImage            = GameObject.Find("Fillimage").GetComponent <Image>();
        fillPercentage       = singlecontrl.currentValue / maxValue;
        fillImage.fillAmount = fillPercentage;


        //소켓은 상대찾기 버튼을 누를때 연결된 소켓을 이용한다
        socketConnection = findteam.socketConnection;

        //바이트버퍼를 담을 수 있는 큐생성
        receivequeue = new Queue <ByteBuffer>();
        //  StartCoroutine(receivall());
        receivequeue_mon = new Queue <ByteBuffer>();

        //thread = new Thread(Receiving);
        //receiveing2 쓰레드 생성
        thread = new Thread(Receiving2);
        //쓰레드 시작
        thread.Start();
    }
Esempio n. 2
0
 // Start is called before the first frame update
 void Start()
 {
     playerinfo = GameObject.FindWithTag("Player").GetComponent <bossplayerinfo>();
 }