本文整理汇总了C#中ActorController类的典型用法代码示例。如果您正苦于以下问题:C# ActorController类的具体用法?C# ActorController怎么用?C# ActorController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActorController类属于命名空间,在下文中一共展示了ActorController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:HowardIfeProjects,项目名称:IsoPuzzle,代码行数:39,代码来源:ACDemo1_Core.cs
示例2: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
controller.actor.body.SetAnimatorThrow();
}
开发者ID:endlosnull,项目名称:GGJ16,代码行数:7,代码来源:Throw.cs
示例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;
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:35,代码来源:AIController.cs
示例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);
}
}
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:25,代码来源:InstantiateBase.cs
示例5: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
controller.actor.Turn(angleDegrees);
}
开发者ID:endlosnull,项目名称:GGJ16,代码行数:7,代码来源:Turn.cs
示例6: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = target.GetComponent<ActorController>();
controller.actionLocked = true;
}
开发者ID:endlosnull,项目名称:GGJ16,代码行数:7,代码来源:LockInput.cs
示例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);
}
开发者ID:endlosnull,项目名称:GGJ16,代码行数:8,代码来源:Jump.cs
示例8: OnInvokeStart
protected override void OnInvokeStart()
{
base.OnInvokeStart();
controller = source.GetComponent<ActorController>();
Ball ball = Field.Instance.ball;
controller.actor.TryTakePossession(ball, this.range);
}
开发者ID:endlosnull,项目名称:GGJ16,代码行数:8,代码来源:Grab.cs
示例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);
}
开发者ID:endlosnull,项目名称:GGJ16,代码行数:9,代码来源:Swat.cs
示例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);
}
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:9,代码来源:SetMaterialGloss.cs
示例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;
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:9,代码来源:MoveStateTarget.cs
示例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();
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:10,代码来源:UIIngameActorTarget.cs
示例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);
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:10,代码来源:HUDTextManager.cs
示例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);
}
开发者ID:pixelbreakfast,项目名称:BoatPpl,代码行数:14,代码来源:Contact.cs
示例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;
}
开发者ID:HowardIfeProjects,项目名称:IsoPuzzle,代码行数:17,代码来源:Tut_2D_Driver_01.cs
示例16: SetInfoLabel
public void SetInfoLabel(ActorController actor, string strBoxInfo)
{
if (actor != null)
{
float num = (!(actor.gameObject.collider == null)) ? ((BoxCollider)actor.gameObject.collider).size.y : 0f;
float y = actor.transform.position.y + num * actor.transform.localScale.y + 0.4f;
this.initPosition = actor.transform.position;
this.initPosition.y = y;
Vector3 position = GameUIManager.mInstance.uiCamera.camera.ViewportToWorldPoint(Camera.main.WorldToViewportPoint(this.initPosition));
position.z = 0f;
base.transform.position = position;
this.mInfo.text = strBoxInfo;
}
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:14,代码来源:UIIngameBoxNotice.cs
示例17: OnFindEnemy
public override void OnFindEnemy(ActorController enemy)
{
base.OnFindEnemy(enemy);
if (!this.dialog)
{
this.dialog = true;
base.StopAttack();
this.AllActorStop();
if (GameUIManager.mInstance.ShowPlotDialog(1002, new GUIPlotDialog.FinishCallback(this.DialogFinish), null))
{
Globals.Instance.ActorMgr.Pause(true);
}
}
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:14,代码来源:AIWizardQueen.cs
示例18: SetAttackTarget
public bool SetAttackTarget(ActorController _target, int _skillIndex, bool _focusTarget)
{
if (_target == null || _target.IsDead)
{
return true;
}
this.target = _target;
this.skillIndex = _skillIndex;
this.focusTarget = _focusTarget;
this.actorCtrler.AiCtrler.Locked = true;
if (this.focusTarget)
{
Globals.Instance.ActorMgr.SetSelectTarget(_target);
}
return this.TryTestGoal();
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:16,代码来源:GoalAttackTarget.cs
示例19: InitWithActorController
public void InitWithActorController(ActorController target, string content, float showTime)
{
if (target == null)
{
return;
}
if (this.mContentDesc == null)
{
this.CreateObjects();
}
this.mContentDesc.text = content;
this.mTargetUnit = target;
this.mSizeY = ((!(this.mTargetUnit.collider == null)) ? this.mTargetUnit.collider.bounds.size.y : 0f);
this.mShowTipTimer = showTime;
this.Show();
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:16,代码来源:GUICombatPaopaoTip.cs
示例20: AttackTarget
public void AttackTarget(ActorController target, int skillIndex, bool focusTarget = true)
{
if (this.curGoal != null)
{
this.curGoal.OnInterrupt();
this.curGoal = null;
}
if (this.attackTargetGoal == null)
{
this.attackTargetGoal = new GoalAttackTarget(this.actorCtrler);
}
if (!this.attackTargetGoal.SetAttackTarget(target, skillIndex, focusTarget))
{
this.curGoal = this.attackTargetGoal;
}
}
开发者ID:floatyears,项目名称:Decrypt,代码行数:16,代码来源:PlayerController.cs
注:本文中的ActorController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论