2021년 6월 17일 목요일

Unity Render Flicker Error

 Sprite Render 때문일수도 있음


나의경우 아주 긴  Sprite Render 를 썻음

2021년 6월 15일 화요일

Unity UI Click Check(유니티 UI 클릭체크)

 using UnityEngine.EventSystems;


if(EventSystem.current.IsPointerOverGameObject())
    return;
    
//클릭처리

2021년 6월 14일 월요일

Unity AnimationClip 에니메이션Clip (역재생,재생)

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

public class SimpleAnimationPlayer : MonoBehaviour
{

    public Animation ani;
    public string clip_name;
    public float ani_time;



    private void Update()
    {
        if (Input.GetKeyDown("1"))
        {
            Show();
        }

        if (Input.GetKeyDown("2"))
        {
            Hide();
        }
    }

    public void Hide()
    {
        if (ani_time == ani[clip_name].length)
            return;

        ani_time = ani[clip_name].time;

        func_playAni(ani_timeclip_name);

    }
    public void Show()
    {
        if (ani_time == 0)
            ani_time = ani[clip_name].length;
        else
            ani_time = ani[clip_name].time;

        func_reversPlay(ani_timeclip_name);
    }


    public void func_playAni(float timestring aniName)
    {
        ani[aniName].time = time;
        ani[aniName].speed = 1;
        ani.Play();
    }

    public void func_reversPlay(float timestring aniName)
    {
        ani[aniName].time = time;
        ani[aniName].speed = -1;
        ani.Play();
    }
}

2021년 4월 28일 수요일

파이썬 스트링

 text = "수익율:{}, 손익가:{}".format(str(stock_data['수익율'].iloc[i]),str(stock_data['손익가'].iloc[i]))


"{} {}".format( 원하는인자1,원하는인자2)


이런식으로 사용

2021년 4월 22일 목요일

[엑셀 활용]최대 최소가 주어질 때 퍼센트,실제값 구하는 방법

퍼센트: 

① 총범위 = 최대값 - 최소값
② 특정값 = 범위내 값 - 최소값
③ 퍼센테이지 = 특정값 / 총범위









실제값:

① 총범위 = 최대값 - 최소값
② 특정값 = 총범위 * 퍼센테이지;
③ 범위내값 = 특정값 + 최소값





2021년 4월 21일 수요일

git rebase 사용법(commit 삭제)

 1. git rebase -i HEAD ~ (원하는 숫자)


그러면 해당하는 커밋들과 함께 vi 창이 나온다 (숫자 맞지 않으면 에러~)




pick 7e298ab 도면정보 시스템 중간정도 완성
pick f89f914 버닝  세이더 삭제 한거 이름 변경함

# Rebase c84faf8..f89f914 onto c84faf8 (2 commands)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everythingthe rebase will be aborted.
#

이런식으로 명령어들과 함께 현재 수정할 커밋들이 나온다



예를들어 이름을 바꾸고 싶으면

pick 7e298ab 도면정보 시스템 중간정도 완성
pick f89f914 버닝  세이더 삭제 한거 이름 변경함

에서

pick 7e298ab 도면정보 시스템 중간정도 완성
r f89f914 버닝  세이더 삭제 한거 이름 변경함

이런식으로 변경하고 :wq를 실행하면 새로운 해당하는 vi창이 새로 열린다

(수정은 i를 누르고 원하는곳을 변경하면 됨)




열린 vi는 다음과 같다

버닝  세이더 삭제 한거 이름 변경함

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# Date:      Thu Apr 22 15:16:37 2021 +0900
#
# interactive rebase in progress; onto c84faf8
# Last commands done (2 commands done):
#    pick 7e298ab 도면정보 시스템 중간정도 완성
#    reword f89f914 버닝  세이더 삭제 한거 이름 변경함
# No commands remaining.
# You are currently editing a commit while rebasing branch 'master' on 'c84faf8'.
#
# Changes to be committed:
#       deleted:    Assets/BurningShader/Assets.meta
#       deleted:    Assets/BurningShader/Assets/Audio.meta
#       deleted:    Assets/BurningShader/Assets/Audio/sfx_Burning.wav
#       deleted:    Assets/BurningShader/Assets/Audio/sfx_Burning.wav.meta
#       deleted:    Assets/BurningShader/Assets/Materials.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_01_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_01_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_02_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_02_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_03_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_03_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_04_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_build_storage_04_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_logpile_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_logpile_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_plank_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_plank_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_wall_logs_met.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/Metallic/mat_wall_logs_met.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_Burn_Slab.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_Burn_Slab.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_01.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_01.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_02.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_02.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_03.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_03.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_04.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_build_storage_04.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_logpile.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_logpile.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_plank.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_plank.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_wall_logs.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Buildings/mat_wall_logs.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Particles.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Particles/mat_embers.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Particles/mat_embers.mat.meta
#       deleted:    Assets/BurningShader/Assets/Materials/Particles/mat_fire.mat
#       deleted:    Assets/BurningShader/Assets/Materials/Particles/mat_fire.mat.meta


이 부분에서 이름을 변경하고 :wq로 저장하면 완료!



삭제하는 동시에 파일도 최신 master 커밋으로 돌아옴!





.git 파일만으로 복원하기(인터넷이 연결이 불가능한 상황에서 로컬에서 혼자 사용할때 유용)

간단하게 혼자서 형상관리 할때 하는 방법(인터넷이 안될때)





1. .git 파일을 원하는 곳에 복사



2. 해당 디렉토리에서 Git Bash 실행



3.git reflog 로 현재 커밋되어있는 목록을 확인한다.



4.git reset --hard (커밋아이디)





로 원하는 커밋으로 복원한다.

git rejected error(feat. cherry-pick)

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