IEnumerator CheckingDistance()
    {
        // 조이스틱 스크립트(조이스틱 사용 유무 판별)
        JoystickScript joystick = GameObject.FindObjectOfType <JoystickScript>();

        // 현재까지 조이스틱 사용 시간
        float conDistance = 0;

        while (true)
        {
            if (joystick.isClicked)
            {
                conDistance += Time.deltaTime;
                if (conDistance > distance)
                {
                    break;
                }
            }
            yield return(null);
        }

        afterReaction.InitAndReact();

        // 이 코루틴 삭제
        Destroy(myCorotine);
    }
예제 #2
0
    // Use this for initialization
    void Start()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }
        joystickScaler = Screen.width / 16f;
        joystickCenter = gameObject.transform.position;

        //centerPos = new Vector2 (Screen.height/2f, Screen.width/2f);

        joystickScalerVec = new Vector2(joystickScaler, joystickScaler);

        /*
         * joystickScalerVecNeg = new Vector2(-joystickScaler, -joystickScaler);
         * joystickScalerVecInv = new Vector2(1f/joystickScaler, 1f/joystickScaler);
         * curTouchPos = Vector2.zero;
         */
    }
 protected override void SpecificInit()
 {
     joyStick  = FindObjectOfType <JoystickScript> ();
     newPlayer = FindObjectOfType <NewPlayer>();
 }