本文整理汇总了C#中ViewModel.BindTransforms方法的典型用法代码示例。如果您正苦于以下问题:C# ViewModel.BindTransforms方法的具体用法?C# ViewModel.BindTransforms怎么用?C# ViewModel.BindTransforms使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ViewModel
的用法示例。
在下文中一共展示了ViewModel.BindTransforms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetViewModel
private void SetViewModel(ViewModel vm, ItemRepresentation rep, IHeldItem item)
{
if (!this.awoke)
{
this.viewModel = vm;
this.rep = rep;
this.item = item;
return;
}
if (this.viewModel != vm)
{
if (this.viewModel)
{
if (this.viewModel.itemRep)
{
try
{
this.viewModel.itemRep.UnBindViewModel(this.viewModel, this.viewModel.item);
}
catch (Exception exception)
{
Debug.LogException(exception, this.viewModel.itemRep);
}
}
this.viewModel.UnBindTransforms();
this.viewModel.idMain = null;
}
this.viewModel = vm;
if (vm)
{
if (!CameraFX.viewModelRootTransform)
{
Transform gameObject = (new GameObject("__View Model Root")).transform;
CameraFX.viewModelRootTransform = (new GameObject("Eye Camera Difference")).transform;
CameraFX.viewModelRootTransform.parent = gameObject;
}
vm.idMain = this.idMain;
vm.transform.parent = CameraFX.viewModelRootTransform;
if (rep)
{
rep.PrepareViewModel(vm, item);
}
vm.BindTransforms(CameraFX.viewModelRootTransform, base.transform.parent);
if (rep)
{
rep.BindViewModel(vm, item);
vm.itemRep = rep;
vm.item = item;
}
}
for (int i = (int)this._effects.Length - 1; i >= 0; i--)
{
if (this._effects[i])
{
this.effects[i].OnViewModelChange(vm);
}
}
}
}