當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。