当前位置: 首页>>代码示例>>C#>>正文


C# Actor.GetType方法代码示例

本文整理汇总了C#中Actor.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Actor.GetType方法的具体用法?C# Actor.GetType怎么用?C# Actor.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Actor的用法示例。


在下文中一共展示了Actor.GetType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Hit

    public void Hit(Actor actor, Vector3 direction, float force) {
        if (actor.GetType() != typeof(Player) || fallen)
            return;

        Rigidbody rigidBody = GetComponent<Rigidbody>();
        rigidBody.AddTorque(direction * this.force, ForceMode.Impulse);
    }
开发者ID:JelleDekkers,项目名称:AfstudeerProject,代码行数:7,代码来源:Firepit.cs

示例2: OnTriggered

 public void OnTriggered(Actor actor) {
     if(actor.GetType() == typeof(Player)) {
         actor.TakeDamage(gameObject, playerDamage * Time.deltaTime);
     } else {
         actor.TakeDamage(gameObject, aiDamage * Time.deltaTime);
     }
 }
开发者ID:JelleDekkers,项目名称:AfstudeerProject,代码行数:7,代码来源:Fire.cs

示例3: ActorMessage

 public void ActorMessage(Actor actor, string message, params object[] args)
 {
     if (IsEnabled() && actor.Id != null && actor.ActorService?.Context?.CodePackageActivationContext != null)
     {
         ActorMessage(
             actor.GetType().ToString(),
             actor.Id.ToString(),
             actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
             actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
             actor.ActorService.Context.ServiceTypeName,
             actor.ActorService.Context.ServiceName.ToString(),
             actor.ActorService.Context.PartitionId,
             actor.ActorService.Context.ReplicaId,
             actor.ActorService.Context.NodeContext.NodeName,
             string.Format(message, args));
     }
 }
开发者ID:Caraul,项目名称:FabricAdcHub,代码行数:17,代码来源:ActorEventSource.cs

示例4: AssignToTarget

    /// <summary>
    /// Sets this health bar to respond to this actor
    /// </summary>
    public void AssignToTarget(Actor newTarget)
    {
        targetActor = newTarget;

        if(targetActor.GetType() == typeof(MechActor)) {
            MechActor mech = (MechActor)targetActor;
            if(mech.armorWeaknessList.Length > 0) {
                //weaknessIcon.enabled = true;

                // TODO: allow for more than one weakness to be displayed in a litte list
                //weaknessIcon.sprite = damageTypeIcons[(int)mech.armorWeaknessList[0]];
            }
            else {
                //weaknessIcon.enabled = false;
            }
        }
    }
开发者ID:tedmunds,项目名称:HavokGear,代码行数:20,代码来源:UI_EnemyHealthBar.cs

示例5: OnTriggered

    public void OnTriggered(Actor actor) {
        // play sound
        
        if(!triggered) {
            spikesParent.transform.position = new Vector3(spikesParent.transform.position.x,
                                              spikesParent.transform.position.y + spikesYOffset,
                                              spikesParent.transform.position.z);
            triggered = true;
        }

        if (actor.GetType() == typeof(Player))
            actor.TakeDamage(gameObject, playerDamage);
        else
            actor.TakeDamage(gameObject, aiDamage);

        spikesTimer = spikesTimerMax;
        ParticleManager.InstantiateParticle(ParticleManager.Instance.Blood, actor.transform.position);
    }
开发者ID:JelleDekkers,项目名称:AfstudeerProject,代码行数:18,代码来源:Spikes.cs

示例6: addToPath

 public void addToPath(Actor l)
 {
     //first off, the obvious
     if(!drawingLine) {
       // Debug.Log("not moving right now.");
       return;
     }
     if(movingActor == l) {
       movingActor.restartPathCheck(this);
     }
     if(l.GetType() == typeof(Monster)) {
       return;
     }
     //if first leaf, make sure it's adjacent to your head
     if(movingActor != null && visitedLeaves.Count == 0 && !leafManager.isAdjacent(l, movingActor.row, movingActor.col)) {
       // Debug.Log("not adjacent to monster head.");
       return;
     }
     if(visitedLeaves.Count > 0 && !leafManager.isAdjacent(l, visitedLeaves[visitedLeaves.Count - 1])) {
       // Debug.Log("not adjacent to last leaf.");
       return;
     }
     if(visitedLeaves.Contains(l)) {
       if(l == visitedLeaves[visitedLeaves.Count - 1]) {
     // Debug.Log("is already the last leaf.");
     return;
       } else {
     int index = visitedLeaves.IndexOf(l);
     int numToRemove = visitedLeaves.Count - index;
     visitedLeaves.RemoveRange(index, numToRemove);
       }
     }
     if(!drawingLine || visitedLeaves.Count >= maxPathLength) {
       return;
     }
     visitedLeaves.Add(l);
     line.clearPositions();
     for(int i = 0; i < visitedLeaves.Count; i++) {
       Actor nl = visitedLeaves[i];
       line.SetPosition(i+1, new Vector3(nl.col*tileSize, nl.row*tileSize, 0));
     }
 }
开发者ID:rvinluan,项目名称:munchmonsters,代码行数:42,代码来源:MunchMonsters.cs

示例7: ActorMessage

 public void ActorMessage(Actor actor, string message, [CallerFilePath] string source = "", [CallerMemberName] string method = "", params object[] args)
 {
     if (!IsEnabled())
     {
         return;
     }
     var finalMessage = string.Format(message, args);
     ActorMessage(
         actor.GetType().ToString(),
         actor.Id.ToString(),
         actor.ActorService.Context.CodePackageActivationContext.ApplicationTypeName,
         actor.ActorService.Context.CodePackageActivationContext.ApplicationName,
         actor.ActorService.Context.ServiceTypeName,
         actor.ActorService.Context.ServiceName.ToString(),
         actor.ActorService.Context.PartitionId,
         actor.ActorService.Context.ReplicaId,
         actor.ActorService.Context.NodeContext.NodeName,
         GetClassFromFilePath(source) ?? "UNKNOWN",
         method ?? "UNKNOWN",
         finalMessage);
 }
开发者ID:paolosalvatori,项目名称:servicefabriceventhubdemo,代码行数:21,代码来源:ActorEventSource.cs

示例8: OnTriggered

 public void OnTriggered(Actor actor) {
     if (actor.GetType() == typeof(Player))
         actor.TakeDamage(gameObject, playerDamage);
     else
         actor.TakeDamage(gameObject, aIDamage);
 }
开发者ID:JelleDekkers,项目名称:AfstudeerProject,代码行数:6,代码来源:Grinder.cs


注:本文中的Actor.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。