本文整理汇总了C#中ActorController类的典型用法代码示例。如果您正苦于以下问题:C# ActorController类的具体用法?C# ActorController怎么用?C# ActorController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActorController类属于命名空间,在下文中一共展示了ActorController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetActor
/// <summary>
/// Sets the new actor that is being controlled
/// </summary>
/// <param name="rActor"></param>
public void SetActor(ActorController rActor)
{
if (rActor == null) { return; }
if (Actor != null)
{
ActorDriver lOldDriver = Actor.gameObject.GetComponent<ActorDriver>();
if (lOldDriver != null) { lOldDriver.IsEnabled = false; }
}
ActorDriver lNewDriver = rActor.gameObject.GetComponent<ActorDriver>();
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;
}
}
示例2: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
controller.actor.body.SetAnimatorThrow();
}
示例3: FindMinDistEnemy
public static ActorController FindMinDistEnemy(ActorController actor, float findDist)
{
if (actor == null)
{
return null;
}
float num = 3.40282347E+38f;
ActorController result = null;
List<ActorController> actors = Globals.Instance.ActorMgr.Actors;
for (int i = 0; i < actors.Count; i++)
{
ActorController actorController = actors[i];
if (actorController && !actorController.IsDead && (!actorController.IsImmunity || actorController.ActorType != ActorController.EActorType.EMonster) && actor.IsHostileTo(actorController))
{
float num2 = actor.GetDistance2D(actorController);
if (num2 <= findDist)
{
if (actorController.ActorType == ActorController.EActorType.EPlayer)
{
num2 *= 1.5f;
if (num2 < 1.5f)
{
num2 = 1.5f;
}
}
if (num2 < num)
{
num = num2;
result = actorController;
}
}
}
}
return result;
}
示例4: DoInstantiate
protected void DoInstantiate(ActorController actor, string socketName, bool onlyUseSocketPosition)
{
this.DoInstantiate(actor);
if (this.go != null && !string.IsNullOrEmpty(socketName))
{
GameObject gameObject = ObjectUtil.FindChildObject(actor.gameObject, socketName);
if (gameObject == null)
{
return;
}
if (onlyUseSocketPosition)
{
this.go.transform.position = gameObject.transform.position;
}
else
{
Transform transform = this.go.transform;
transform.parent = gameObject.transform;
transform.localPosition = Vector3.zero;
transform.localRotation = Quaternion.identity;
transform.localScale = Vector3.one;
actor.AddPoolSocket(transform);
}
}
}
示例5: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
controller.actor.Turn(angleDegrees);
}
示例6: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = target.GetComponent<ActorController>();
controller.actionLocked = true;
}
示例7: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
controller.actor.physics.velocity += Vector3.up * force;
AudioManager.Instance.PlayOneShot(controller.actor.audioSource, AudioManager.Instance.jump);
}
示例8: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
Ball ball = Field.Instance.ball;
controller.actor.TryTakePossession(ball, this.range);
}
示例9: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
controller.actor.body.SetAnimatorThrow();
Ball ball = Field.Instance.ball;
controller.actor.TrySwatBall(ball, this.range, this.yRange);
}
示例10: ChangeControllerGloss
public static void ChangeControllerGloss(ActorController controller, Color color, float gloss, float lerp, float hold)
{
List<CharacterMeshInfo> meshInfos = controller.MeshInfos;
for (int i = 0; i < meshInfos.Count; i++)
{
CharacterMeshInfo characterMeshInfo = meshInfos[i];
characterMeshInfo.ChangeToColor(color, gloss, lerp, hold);
}
}
示例11: SetTarget
public void SetTarget(ActorController target, float attackDistance)
{
if (this.Target != null)
{
this.Target.AiCtrler.ReleaseChaser(this.actorCtrler);
}
this.Target = target;
this.distance = attackDistance;
}
示例12: Init
public void Init(ActorController target)
{
if (target == null)
{
return;
}
this.mTargetUnit = target;
this.mSizeY = ((!(this.mTargetUnit.collider == null)) ? this.mTargetUnit.collider.bounds.size.y : 0f);
this.Show();
}
示例13: RequestShow
public void RequestShow(ActorController actor, EShowType showType, int value = 0, string text = null, int type = 0)
{
ShowData showData = new ShowData();
showData.actor = actor;
showData.showType = showType;
showData.type = type;
showData.value = value;
showData.text = text;
this.textLists.Add(showData);
}
示例14: Start
//List<Collider> ignore = new List<Collider>();
// Use this for initialization
void Start()
{
Messenger.AddListener("start_voyage", SetCanRepel);
capsuleCollider = GetComponent<CapsuleCollider>() as CapsuleCollider;
actorController = transform.gameObject.GetComponent<ActorController>();
health = transform.GetComponent<Health>() as Health;
//InvokeRepeating("CheckContact", 0, 0.05f);
}
示例15: Awake
/// <summary>
/// Once the objects are instanciated, awake is called before start. Use it
/// to setup references to other objects
/// </summary>
protected virtual void Awake()
{
// Grab the actor controller so we can set it's values later
mActorController = gameObject.GetComponent<ActorController>();
// Object that will provide access to the keyboard, mouse, etc
if (InputSourceOwner != null) { mInputSource = InterfaceHelper.GetComponent<IInputSource>(InputSourceOwner); }
// Default speed we'll use to rotate. To help smooth out the rotation,
// We make it consistant even in low frame rates, by set the standard to be a
// rotation if we're running at 60 frames per second.
mDegreesPer60FPSTick = RotationSpeed / 60f;
}