console.cloud.google.com/

 

Google Cloud Platform

하나의 계정으로 모든 Google 서비스를 Google Cloud Platform을 사용하려면 로그인하세요.

accounts.google.com

구글 디벨로퍼 콘솔에서 연동된 API의 OAuth 동의 화면(인증 화면)을 확인한다.
게시 상태 <프로덕션 단계>가 출시가 아닌 테스트인지(출시, 테스트로 언제든 바꿀 수 있다.)
테스트인데 테스터가 등록되어 있지 않은지 확인!

'Unity > 구글' 카테고리의 다른 글

Gradle build failed. See the console for details  (0) 2021.04.05
구글 서치 콘솔 소유권 확인  (0) 2020.07.23

빌드 시 Gradle build failed. See the console for details 에러

문제가 여러가지 있는데 아는 경우가 몇가지 있다.

1. CommandInvokationFailure: Gradle build failed.(확인)
-> 파일 경로상에 한글이 포함된 경우 빌드오류


2. 에러 메시지 중
This project uses AndroidX dependencies, but the 'android.useAndroidX' property is not enabled. Set this property to true in the gradle.properties file and retry.

이 보이면
방법 1) gradleTemplate.gradle에 android.useAndroidX=true 추가
방법 2) mainTemplate.gradle에 추가 today7e.blogspot.com/2018/06/android.html

 

[Unity Android] Gradle MultiDex을 이용한 Dex 64k 참조 제한 해결 방법 정리

게임 개발에 대한 이야기를 나누는 블로그입니다.

today7e.blogspot.com

 

3. 그냥 안되는 경우도 있다.

- 유니티 종료
- C:\Users\사용자\.gradle\caches 안에 폴더 다 지우기
- C:\Users\nomea\AppData\LocalLow\해당패키지이름 폴더째로 삭제
- 재부팅

'Unity > 구글' 카테고리의 다른 글

구글 로그인 무한로딩  (0) 2021.04.06
구글 서치 콘솔 소유권 확인  (0) 2020.07.23

'Unity > 구글' 카테고리의 다른 글

구글 로그인 무한로딩  (0) 2021.04.06
Gradle build failed. See the console for details  (0) 2021.04.05

개선이 조금 필요함

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Move : MonoBehaviour
{

    private float moveSpeed;
    private Transform tr;
    private Vector2 initTouchDown;
    private Vector2 initDrag;

    private void Start()
    {
        tr = GetComponent();
        moveSpeed = 0.1f;
    }


    private void Update()
    {
        PlayerMove();
    }

    private void PlayerMove()
    {
        if (Input.GetMouseButtonDown(0))
        {
            initTouchDown = Input.mousePosition;
        }

        if (Input.GetMouseButton(0))
        {
            initDrag = Input.mousePosition;
            initDrag = (initDrag - initTouchDown).normalized;
            Debug.Log("initTouchDown : " + initTouchDown + "  initDrag : " + initDrag);
            tr.Translate(initDrag * moveSpeed);
        }
    }
}

 

========================================================================================================================================================

약간 개선된 코드

    using UnityEngine;

    public class Move : MonoBehaviour
    {

        private float moveSpeed;
        private Transform tr;
        private Vector2 initTouchDown;
        private Vector2 initDrag;

        private void Start()
        {
            tr = GetComponent();
            moveSpeed = 0.1f;
        }



        private void Update()
        {
            PlayerMove();
        }

        private void PlayerMove()
        {
            if (Input.GetMouseButtonDown(0))
            {
                initTouchDown = Input.mousePosition;
            }

            if (Input.GetMouseButton(0))
            {
                initDrag = Direction(initTouchDown, Input.mousePosition);
                tr.Translate(initDrag * moveSpeed);
            }
        }

        private Vector2 Direction(Vector2 fir, Vector2 sec)
        {
            if (fir.x <= sec.x + 50 && fir.x >= sec.x - 50)
            {
                if (fir.y <= sec.y + 50 && fir.y >= sec.y - 50)
                    return Vector2.zero;
                else
                    return new Vector2(0, sec.y - fir.y).normalized;
            }
            else
            {
                if (fir.y <= sec.y + 50 && fir.y >= sec.y - 50)
                    return new Vector2(sec.x - fir.x, 0).normalized;
                else
                    return (sec - fir).normalized;
            }
        }
    }

'Unity > Unity자체' 카테고리의 다른 글

마우스 8방향 이동  (0) 2020.03.09

긁기용

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Move : MonoBehaviour
{

    private float moveSpeed;
    private Transform tr; //움직일 오브젝트의 트렌스폼
    private Vector2 initTouchDown;
    private Vector2 initDrag;
    private Camera mainCamera;

    void Start()
    {
        tr = GetComponent();
        moveSpeed = 0.1f;
        mainCamera = GameObject.Find("Main Camera").GetComponent();
    }


    // Update is called once per frame
    void Update()
    {
        PlayerMove();
    }

    private void PlayerMove()
    {
        if (Input.GetMouseButtonDown(0))
        {
            initTouchDown = Input.mousePosition;
        }

        if (Input.GetMouseButton(0))
        {
            initDrag = Input.mousePosition;
            Debug.Log("initTouchDown : " + initTouchDown + "  initDrag : " + initDrag);
            MoveSwitch(Direction(initTouchDown, initDrag)); //fir Vec2, sec Vec2
        }
    }

    private int Direction(Vector2 fir, Vector2 sec)
    {
        if(fir.x <= sec.x + 40 && fir.x >= sec.x - 40)
        {
            if (fir.y <= sec.y + 40 && fir.y >= sec.y - 40)
                return 1; //정지
            else if (fir.y > sec.y)
                return 2; //아래
            else
                return 3; //위
        }
        else if(fir.x > sec.x + 40)
        {
            if (fir.y <= sec.y + 40 && fir.y >= sec.y - 40)
                return 4; //왼쪽
            else if (fir.y > sec.y)
                return 5; //왼쪽아래
            else
                return 6; //왼쪽위에
        }
        else
        {
            if (fir.y <= sec.y + 40 && fir.y >= sec.y - 40)
                return 7; //오른쪽
            else if (fir.y > sec.y + 40)
                return 8; //오른쪽아래
            else
                return 9; //오른쪽위에
        }
    }

    private void MoveSwitch(int move)
    {
        switch (move)
        {
            case 1:
                tr.Translate(Vector2.zero * moveSpeed);
                break;
            case 2:
                tr.Translate(-Vector2.up * moveSpeed);
                break;
            case 3:
                tr.Translate(Vector2.up * moveSpeed);
                break;
            case 4:
                tr.Translate(-Vector2.right * moveSpeed);
                break;
            case 5:
                tr.Translate(-Vector2.right * moveSpeed / 2);
                tr.Translate(-Vector2.up * moveSpeed / 2);
                break;
            case 6:
                tr.Translate(-Vector2.right * moveSpeed / 2);
                tr.Translate(Vector2.up * moveSpeed / 2);
                break;
            case 7:
                tr.Translate(Vector2.right * moveSpeed);
                break;
            case 8:
                tr.Translate(Vector2.right * moveSpeed /2);
                tr.Translate(-Vector2.up * moveSpeed / 2);
                break;
            case 9:
                tr.Translate(Vector2.right * moveSpeed / 2);
                tr.Translate(Vector2.up * moveSpeed / 2);
                break;
        }
    }
}

 

'Unity > Unity자체' 카테고리의 다른 글

마우스 조이스틱  (0) 2020.03.09

+ Recent posts