Ejemplo n.º 1
0
 void Start()
 {
     playerProperty     = GetComponent <PlayerProperty>();
     playerBehaviour    = GetComponent <PlayerBehaviour>();
     constellation      = GetComponent <Constellation>();
     moveSlider         = GameObject.Find("MoveSlider").GetComponent <MoveSlider>();
     waitForFixedUpdate = new WaitForFixedUpdate();
     model        = transform.GetChild(6).gameObject;
     JumpCount    = 0;
     playerUpdate = PlayerUpdate();
     StartCoroutine(playerUpdate);
 }
Ejemplo n.º 2
0
    IEnumerator PlayerUpdate()
    {
        while (!playerProperty.IsDead)
        {
            yield return(waitForFixedUpdate);

            float sliderValue = MoveSlider.GetSliderValue();

            if (!GetComponent <Rigidbody2D>().constraints.Equals(RigidbodyConstraints2D.FreezePositionX | RigidbodyConstraints2D.FreezeRotation))
            {
                transform.Translate(new Vector2(sliderValue * playerProperty.MoveSpeed * Time.deltaTime, 0));
            }

            ConstellationUpdate();
            //AnimationUpdate(sliderValue); // 모바일 입력 코드
            Test_KeyboardInput(); // PC(테스팅) 임시 입력 코드
        }
    }