2019년 7월 31일 수요일

네코랜드 - 스킬구현

currentPosition = Point(0,0)
updateTimeUseSkill = 0

-- Use Skill
function UseSkill(index)
    Client.myPlayerUnit.UseSkill(index)
end

--스킬을 사용할 수 있는 상태인지.
function UseSkillState()
   
    if currentPosition.x == Client.myPlayerUnit.x and
        currentPosition.y == Client.myPlayerUnit.y then
        updateTimeUseSkill = updateTimeUseSkill + 1
    else       
        currentPosition.x  = Client.myPlayerUnit.x
        currentPosition.y = Client.myPlayerUnit.y
        updateTimeUseSkill = 0
    end

    if updateTimeUseSkill >= 50 then
        UseSkill(1)
        updateTimeUseSkill = 0
    end
end

Client.onTick.Add(UseSkillState, 0.01)

2017년 1월 23일 월요일

Unity Facebook, Google 로그인(Login) - 계정 승인 오류시

Facebook, Google Login 작업

1) 계정 작업시 승인 요청 안될 경우
 - 테스터를 모두 지우고 다시 추가한다.
 

2017년 1월 22일 일요일

Node.JS 모듈을 통한 app.post 설정


다른 모듈을 통해서 app.get, app.post 설정할 수 있다.

ex)
 router_loader.js
 var curIModule = require('./users");

 app.post('/process/login", curModule['모듈에 선언한 Method 이름(login)']);
 // 모듈에 선언한 이름이 login 이므로  login으로 설정해야함.
 // loginInit 로 하면 에러 발생

 users.js
 
 var loginInit = function(req, res){
 ~~~~~~~~~~
};

module.exports.login = loginInit;

2017년 1월 12일 목요일

Unity5 Push기능 Firebase (FCM) 이용

* 유니티 푸시 기능 (FCM) Firebase *

1) https://console.firebase.google.com 로 들어가 새 프로젝트를 만든다.
2) 프로젝트를 만든후 톱니바퀴를 눌러 '프로젝트 설정'으로 들어간다.
3) google-services.json 파일을 내려받는다.
https://firebase.google.com/docs/analytics/unity/start 사이트를 통해 Firebase Unityu SDK를 받는다.

4) 유니티로 새프로젝트 생성후 firebase unity SDK 를 import한다.
5) 임포트한 후에 'plugins/Firebase/' 폴더 안에 google-services.json 파일을 복사한다.
6) 재 빌드 한다.


빌드를한다. 

Firebase 웹사이트 
Notifications이동
-> 메시지 내용 적는다.
-> 앱을 설정 한다. com.~~~.~~~

메세지를 보내본다.

구글 연결 방법 - Firebase Key 입력

2017년 1월 11일 수요일

Unity5 그리고 GooglePlayService 그리고 UnityIAP(InApp)

* 유니티 구글 플레이 & IAP(InApp)연동시 문제점 *

1) 구글플레이서비스

// 설정에 주의 하자.
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
         // enables saving game progress.
         .EnableSavedGames()      
         // require access to a player's Google+ social graph (usually not needed)
         .RequireGooglePlus()
         .Build();

예를 들어 유니티 코드에 위와같이 되어있을 때 구글 플레이설정쪽에 똑같이 안되어 있으면 에러(승인요청에러)발생한다.

- 아래 이미지 참조.

아래 이미지 보면 코드와 일치하지 않음 EnableSavedGame이라 해놓고 사용안함으로 되어있음.



2) IAP ( In App )
Google Play In app 은 반드시 게시(public)를 해야하지만 테스트 할 수 있다.
그래서 '출시할 수 없는 이유가 무엇인가요?' <- 이 조건을 충족해야한다.


테스트라해서 조건들을 충족시켜주지 못한다면 테스트조차 할 수 없다.










2017년 1월 8일 일요일

Node JS 모듈 그리고 객체

exports에 객체를 할당하면 모든 파일 안에서 선언한 exports는 모듈시스템에서 처리할 수 있는 전역변수가 아닌 단순 변수로 인식.

즉, 할당된 변수가 아니라서 이 변수들을 참조 할 수 없어 에러가 발생함.

example 1.

// user1.js  
exports = {
getUser : function(){
return { id: 'test01' , name : 'testuser'};
},
group: {id : 'group01', name: 'testuser2'}
};

// app.js

var user = require('./users1.js');
console.dir(user);  // OK

function showUser(){
   return user.gerUser().name + ' , ' + user.group.name; // ERROR
}

console.log(showUser());


--> 그럼 이런식으로 변경한다.

// user1.js
var user = {
getUser : function(){
return { id: 'test01' , name : 'testuser'};
},
group: {id : 'group01', name: 'testuser2'}
};

module.exports = user;

module.exports 사용할것 exports사용하게되면 할당 안되거나 모듈을 불러들인 쪽으로 전달이 안됨.


다시 -> 할당을 안한상태
// user7.js
exports.printUser = function(){
   console.log(' user7 ' );
};

// moduletest.js
var printout = require('./user7.js').printUser; // 할당 후 사용

printout();

--> 할당하여 사용.
// user7.js
var printuser = function(){
   console.log('user7');
}

module.exports = printuser;


이런식으로 사용한다.

2017년 1월 6일 금요일

Node JS GM

NodeJS
gm 을 사용하려면 윈도우일 경우

ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/

var gm = require('gm');

에서 먼저 설치후 gm 을 실행 해야합니다.

혹시나 이클립스로 작업하다가 안된다면 이클립스 재실행해야 합니다.

콘솔창이 이미 실행된 상태에서 설치를 했다면 당연히 gm에 대한 패스가 적용되지 않기 때문입니다.