コード例 #1
0
 protected override void Awake()
 {
     base.Awake();
     animator            = GetComponentInChildren <Animator>();
     controllerEventArgs = new LogicEventArgs <CameraTarget>().SetData(GetComponentInChildren <CameraTarget>());
     Facade.SetInputDevice(new StandardInputDevice());
     Facade.RegisterController(this);
 }
コード例 #2
0
 /// <summary>
 /// 开始时候执行一次
 /// 属于Start函数
 /// </summary>
 void CameraHandler(object sender, GameEventArgs args)
 {
     controllerEventArgs = args as LogicEventArgs <CameraTarget>;
     CameraTarget        = controllerEventArgs.Data;
     cam = GetComponentInChildren <Camera>();
     cam.transform.ResetLocalTransform();
     transform.rotation          = CameraTarget.transform.rotation;
     currentDistance             = distanceFromTarget;
     cameraOffset.z              = -currentDistance;
     cam.transform.localPosition = cameraOffset;
 }