2019년 4월 17일 수요일

string 자르기

string 자르기

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CurrentPath = Application.dataPath;
 
            string[] tmptmp = CurrentPath.Split('/');
 
            string realPath =null;
 
            for (int i = 0; i < tmptmp.Length-1; i++)
 
            {
 
                if (i != tmptmp.Length - 1)
 
                    realPath += tmptmp[i] + '/';
 
                else
 
                    realPath += tmptmp[i] +'/'+"Models";
 
            }
 
         
 
            CurrentPath = realPath;
cs

2019년 4월 16일 화요일

UnityEditor 사용시 주의점

UnityEditor를 사용하는 스크립트는 전부

Asset/Editor 폴더안에 들어가서 사용해야한다

아니면 빌드시 에러발생

LNK1104 'libfbxsdk-md.lib' 파일을 열 수 없습니다.

라이브러리 디렉터리 폴더를 추가 해주면됨~ ㅅㄱㄹ~

방법은 fbxsdk.h와 같은 방식이다

fbxsdk.h: No such file or directory

아마 포함 디렉터리에 맞지 않는 버전(2019 or 2018 의 fbx sdk)

본인은 2019만 추가 되어 있어서 2017도 추가 했더니 해당 Error 가 사라짐




이렇게 해주면 일단
해당 Error는 사라짐

2019년 4월 11일 목요일

heidisql 이름 쿼리(feat. update,randomValue, string + int)


이름 출력 쿼리(feat. heidisql string+int)
  SET nC = CONCAT('CT0',CAST(t_INT AS CHAR(10)));

##CONCAT('string','string');

int to string?? 

CAST(int as char(10));


DELIMITER $$
DROP PROCEDURE IF EXISTS query_test $$
CREATE PROCEDURE query_test(IN var INT)
BEGIN
    DECLARE nCnt INT DEFAULT 0;
    DECLARE t_INT INT DEFAULT 10100;
DECLARE nC varchar(100) DEFAULT 'CT0';
 
    WHILE (nCnt < var) DO
    SET nCnt = nCnt + 1;
    SET t_INT = t_INT + 1;
  SET nC = CONCAT('CT0',CAST(t_INT AS CHAR(10)));

  SELECT nC;
 
#    SELECT nC AS 결과;
    END WHILE;
    
END $$
DELIMITER ;


UPGRADE 직접 INSERT하는 프로시져

DELIMITER $$
DROP PROCEDURE IF EXISTS query_test $$
CREATE PROCEDURE query_test(IN var INT)
BEGIN
    DECLARE nCnt INT DEFAULT 0;
    DECLARE t_INT INT DEFAULT 10100;
DECLARE nC varchar(100) DEFAULT 'CT0';
 
    WHILE (nCnt < var) DO
    SET nCnt = nCnt + 1;
    SET t_INT = t_INT + 1;
  SET nC = CONCAT('CT0',CAST(t_INT AS CHAR(10)));
 
//assembly_usedtime에 해당하는 데이터를넣는다
INSERT INTO assembly_usedtime VALUES(nC,100,DEFAULT,200,100,RAND()*(10000-9700)+9700,100);
  SELECT nC;
 
#    SELECT nC AS 결과;
    END WHILE;
    
END $$

DELIMITER ;



//RANDOM VALUE 사용법
number >= min and <max
RAND()*(max-min)+min

number >= 9700 and <10000

RAND()*(10000-9700)+9700








2019년 4월 9일 화요일

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1


heidiSQL에서 발생한 Error

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1
마지막 줄

   
END $$
DELIMITER;

에서

DELIMITER ;

이렇게 세미콜론과 DELIMITER를 띄워쓰면 에러가 사라짐 ㅋ


Unity Web 링크 열기 (OpenURL for Unity)


1
2
3
4
5
6
7
public void WebLink()
    {
        Application.OpenURL("원하는 주소");
    }
cs

ScrollBar 맨밑으로 업데이트 하기

그냥 ScrollBar.Value = 0 으로하니까 왜 되지?? 안된적이 있었는데...

unity 쿨타임 버튼 구현 (원 , 사각형?)




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
CircleDraw
 
 
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
 
public class CircleDraw : MonoBehaviour {
 
    Image m_image;
    public float degree;
 
 // Use this for initialization
 void Start () {
        m_image = this.gameObject.GetComponent<Image>();
    }
 
 
 
 
 
    public void SetdegreeCircle(float angle)
    {
        degree = angle;
        m_image.fillAmount = (angle / 360);
    }
 
 
    public void SetdegreeCircle_otherSide(float angle)
    {
        float tmp = 360 - angle;
        degree = tmp;
        m_image.fillAmount = (tmp / 360);
    }
 
 
 
    public float _getDegree()
    {
        return degree;
    }
}
cs

클릭시 UI 체크

//UI를 클릭하면 다른것은 실행안하고 넘긴다.
if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject()) return;   


Raycast Target check해제 하면 UI 위를 클릭해도 해당 좌표를 클릭한 효과를줌
캡션 추가

git rejected error(feat. cherry-pick)

 문제 아무 생각 없이 pull을 받지않고 로컬에서 작업! 커밋, 푸시 진행을 해버렷다. push에선 remote와 다르니 당연히 pull을 진행해라고 하지만 로컬에서 작업한 내용을 백업하지 않고 진행하기에는 부담스럽다(로컬작업 유실 가능성) 해결하려...