public bool legacy ;

描述

如果将把 AnimationClip 与旧版动画组件(而不是动画器)结合使用,则设置为 true。

using UnityEngine;
using System.Collections;

public class animFov : MonoBehaviour { void Start() { AnimationClip fovc = new AnimationClip(); AnimationCurve curve = AnimationCurve.Linear(0.0f, 60.0f, 10.0f, 90.0f); fovc.SetCurve("", typeof(Camera), "field of view", curve); fovc.legacy = true; GetComponent<Animation>().AddClip(fovc, "animfov");

GetComponent<Animation>().Play("animfov"); } }
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961