2025유니티수업

0418 씨네머신 카메라 / c# 코딩 기초

버스창문 2025. 4. 18. 14:48

state Driven Camera

행동마다 작동하는 카메라를 다르게 할 수 있음

 

1번카메라

아무것도 할당하지 않음

2번카메라

1번 카메라와 동일한 위치, Look At에 플레이어 카메라루트 할당

 

 

 

3번카메라(free look)

follow, look at 둘다 할당

 

state driven

animate target에 플레이어 할당

 

new state : 하나만 생성

all 어쩌구 : 행동에 할당안된 모든 행동 생성

 

 

 

 

걸을때

가만히

 

스샷이 안찍히는데 뛰면 free look으로

 

 

 

 

clear shot

장애물이 카메라를 가릴 때 다른 카메라로 전환

 

1번 카메라

 

 

 

 

2번 카메라

 

3번 카메라

 

 

 

clear shot 안에 카메라 전부에

콜라이더를 넣어야함

 

 

 

 

 

 

돌리트랙

 

 

 

둘다 좌표 000

 

 

 

 

 

버츄얼 카메라 -> body -> auto dolly

카메라가 레일따라 움직임

루프 시키기도 가능

 

 

+

카메라 안에 다른카메라 넣는건 되는데

state driven 안에 돌리트랙은 넣지못함

 

 

 

 

 

 

돌리트랙(카트)

 

 

follow에 cart넣고

Look at에 플레이어 넣고

트랙 돌리 설정후 path에 돌리트랙

 

 

 

 

 

 

타겟 그룹 카메라

무리지어서 다니는 그룹을 타겟으로 잡는 카메라

 

 

아무 큐브나 대충 뽑아서 넣기

 

3개가 다 들어가게 카메라를 잡아줌

 

움직여도 같이 잡아줌

 

 

 

믹싱 카메라

 

안에 있는 카메라의 값들을 평균내서 가상의 카메라로 만듬

 

 

 

 

______________________________________________________________

 

 

 

 

static : 미리 메모리 할당 되는 것/ 정적 메모리

 

using System.Security.AccessControl;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

namespace _0418_CSharp
{
    internal class Program
    {
        //static : 미리 메모리 할당 되는 것/ 정적 메모리
        static void Main(string[] args)
        {
            /*Console.WriteLine("MBC \n 아카데미");
            int num0 = 20; // integer
            int num1 = 30;
            int sum = num0 + num1;
            Console.WriteLine(sum);*/

            Console.WriteLine("정수 입력 : ");
            string a = Console.ReadLine()!;
            int n1 = int.Parse(a);
            Console.WriteLine("입력된 숫자 : " + n1 + ".");
            n1++;
            Console.WriteLine("입력된 숫자 + 1 : " + n1 + ".");
            --n1;
            Console.WriteLine(n1);


            A1();
        }

        public static void A1()
        {

        }
    }
}

 

 

 

 

region / endregion

이름 있는 주석 느낌

using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _0418_CSharp
{
    internal class Class1
    {
        public static void A1()
        {
            Console.WriteLine("MBC \n 아카데미");
            int num0 = 20; // integer
            int num1 = 30;
            int sum = num0 + num1;
            Console.WriteLine(sum);

            Console.WriteLine("정수 입력 : ");
            string a = Console.ReadLine()!;
            int n1 = int.Parse(a);
            Console.WriteLine("입력된 숫자 : " + n1 + ".");
            n1++;
            Console.WriteLine("입력된 숫자 + 1 : " + n1 + ".");
            --n1;
            Console.WriteLine(n1);
        }
        public static void A2()
        {
            #region int형 float double 변수 선언 및 초기화
            int a = 10;
            int b = 20;
            int c;
            c = 1557;

            Console.WriteLine($"{a} {b} {c}");

            float f1 = 3.14f;
            float f2 = 2.71828182845904523536028747135266249f;

            double d1 = 2.71828182845904523536028747135266249;
            Console.WriteLine($"{f1} // {f2} // {d1}");
            #endregion
        }
        public static void A3()
        {

            #region 입력 받아서 콘솔에 출력 하기
            Console.Write("정수 두개를 입력 바람\n");
            Console.Write("첫번째 : ");
            int n1 = int.Parse(Console.ReadLine());
            Console.Write("두번째 : ");
            int n2 = int.Parse(Console.ReadLine());
            int sum = n1 * n2;
            Console.WriteLine("합계 : " + sum);
            Console.WriteLine($"합계 : {sum}");

            #endregion
        }
        public static void A4()
        {
            #region 문자열로 입력 받아서 출력하기
            string? name = null;
            string? adress = null;
            string? phoneNum = null;
            //int phoneNum = 0;
            Console.Write(" 이름을 입력 : ");
            name = Console.ReadLine();
            //Console.WriteLine($"이름 : {name}");
            Console.Write(" 주소를 입력 : ");
            adress = Console.ReadLine();
            //Console.WriteLine($"주소 : {adress}");
            Console.Write(" 전화번호 입력 : ");
            phoneNum = Console.ReadLine();
            //phoneNum = int.Parse(Console.ReadLine());
            Console.WriteLine($"이름 : {name} \n주소 : {adress} \n전화번호 : {phoneNum}");

            #endregion
        }
        public static void A5()
        {
            string name = "홍길동";
            int age = 20;
            int adress1 = 123;
            int adress2 = 456;
            Console.WriteLine("이름 : " + name + $"\n나이 : {age}\n주소 : {adress1} - {adress2}");
            Console.WriteLine($"{4} x {5} = {4*5}");
            Console.WriteLine($"{7} x {9} = {7*9}");
            Console.WriteLine("______________________________");
            
        }
        public static void A6() {
            int n1 = 0;
            int n2 = 0;
            Console.Write("첫번째 숫자 : ");
            n1 = int.Parse(Console.ReadLine());
            Console.Write("두번째 숫자 : ");
            n2 = int.Parse(Console.ReadLine());
            Console.WriteLine($"n1 - n2 = {n1 - n2} // n1 x n2 = {n1 * n2}");
            int num1 = 0;
            int num2 = 0;
            int num3 = 0;
            Console.Write("첫번째 숫자 입력 : ");
            num1 = int.Parse(Console.ReadLine());
            Console.Write("두번째 숫자 입력 : ");
            num2 = int.Parse(Console.ReadLine());
            Console.Write("세번째 숫자 입력 : ");
            num3 = int.Parse(Console.ReadLine());

            Console.WriteLine($"{num1} x {num2} + {num3} = {(num1*num2) + num3}");


            int sq = 0;
            Console.Write("제곱할 숫자 입력 : ");
            sq = int.Parse(Console.ReadLine());
            Console.WriteLine($"{sq*sq}");

            int number1 = 0;
            int number2 = 0;

            Console.Write("첫번째 숫자 입력 : ");
            number1 = int.Parse(Console.ReadLine());
            Console.Write("두번째 숫자 입력 : ");
            number2 = int.Parse(Console.ReadLine());
            int mok = number1 / number2;
            Console.WriteLine($"몫 : {mok} , 나머지 : {number1 % number2}");




        }
        public static void A7()
        {
            int num1 = 0;
            int num2 = 0;
            int num3 = 0;
            Console.Write("첫번째 숫자 입력 : ");
            num1 = int.Parse(Console.ReadLine());
            Console.Write("두번째 숫자 입력 : ");
            num2 = int.Parse(Console.ReadLine());
            Console.Write("세번째 숫자 입력 : ");
            num3 = int.Parse(Console.ReadLine());

            Console.WriteLine($"(num1 - num2) x (num2 + num3) x (num3 % num1) = { (num1 - num2) *(num2 + num3) *(num3 % num1)}");
        }
    }
}