"景先生毕设|www.jxszl.com

C# ActorController类代码示例

2023-12-29 16:59编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中ActorController类的典型用法代码示例。如果您正苦于以下问题:C# ActorController类的具体用法?C# ActorController怎么用?C# ActorController使用的例子? 这里精选的类代码示例或许可以为您提供帮助。 示例1: SetActor /// /// Sets the new actor that is being controlled /// /// public void SetActor(ActorController rActor) { if (rActor == null) { return; } if (Actor != null) { ActorDriver lOldDriver = Actor.gameObject.GetComponent(); if (lOldDriver != null) { lOldDriver.IsEnabled = false; } } ActorDriver lNewDriver = rActor.gameObject.GetComponent(); if (lNewDriver != null) { lNewDriver.IsEnabled = true; } Actor = rActor; if (mCameraRig != null) { mCameraRig.Anchor = Actor.transform; } else if (mCamera != null) { mCamera.transform.parent = Actor.transform; mCamera.transform.localPosition = new Vector3(0f, 1.5f, -4f); Vector3 lLookTarget = Actor.transform.position + (Actor.transform.up * 1f); mCamera.transform.rotation = Quaternion.LookRotation(lLookTarget - mCamera.transform.position, Actor.transform.up); } if (mActorText != null && mActorDescriptions.ContainsKey(rActor.gameObject.name)) { mActorTextTimer = 0f; mActorText.text = mActorDescriptions[rActor.gameObject.name]; mActorText.enabled = true; } }
原文链接:http://www.jxszl.com/biancheng/C/556476.html