盛世光影(北京)科技有限公司unity面试题

2021-05-18 09:04发布


1、组件

2、碰撞器  刚体  运动

3、Awake  OnEnable  Start

4、RotateAround    Rotate

5、Directional  Point   Spot   Area

6、List 对象  空间换时间  子弹  敌人  特效

7、public protected private internal

10、

       static long array(int n)
        {
            if (n.Equals(0))
            {
                return 1;
            }
            if (n.Equals(1))
            {
                return 1;
            }
            return (array(n - 1) + array(n - 2));
        }
        static void Main(string[] args)
        {
            Console.WriteLine(array(6)) ;
            Console.ReadLine(); 
 
        }

 

 

 

static long array(int n)
        {
            if (n.Equals(0))
            {
                return 1;
            }
            if (n.Equals(1))
            {
                return 1;
            }
            return (array(n - 1) + array(n - 2));
        }
        static void Main(string[] args)
        {
            Console.WriteLine(array(6)) ;
            Console.ReadLine(); 
 
        }

 

 

 

 

 

11、

       using System.Collections;

using System.Collections.Generic;

using UnityEngine;

 

public class Test : MonoBehaviour {

 

    public Vector3 p0;

    public Vector3 p1;

    public Vector3 p2;

    float time = 0;

    // Use this for initialization

    void Start () {

        p0 = new Vector3(0, 0, 0);

        p1 = new Vector3(2, 4, 0);

        p2 = new Vector3(5, 0, 0);

    }

   

    // Update is called once per frame

    void Update () {

        time += Time.deltaTime;

        time = Mathf.Clamp(time,0, 1);

        transform.position = (1 - time) * (1 - time) * p0 + 2 * time * p1 * (1 - time) + time * time * p2;

    }

}