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


C# GameObject.Equals方法代码示例

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


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

示例1: GetPositionForGO

    public BoardPosition GetPositionForGO(GameObject go)
    {
        BoardPosition position = default(BoardPosition);

        foreach (KeyValuePair<BoardPosition, GameObject> tile in board)
        {
            if (go.Equals(tile.Value))
            {
                position = tile.Key;
                break;
            }
            Renderer r = tile.Value.GetComponent<Renderer>();
            if (r != null)
            {
                Bounds b = r.bounds;
                if (go.transform.position.x >= b.min.x && go.transform.position.x <= b.max.x && go.transform.position.y >= b.min.y && go.transform.position.y <= b.max.y)
                {
                    position = tile.Key;
                    break;
                }
            }
        }

        return position;
    }
开发者ID:Mitsugaru,项目名称:Salpakan,代码行数:25,代码来源:BoardManager.cs

示例2: OnParticleCollision

 void OnParticleCollision( GameObject other)
 {
     if ( other.Equals( GameObject.FindWithTag( "Player" ) ) )
     {
         mm.increaseMovementSpeedTemporarily();
        }
 }
开发者ID:unia-intsim-ws1516,项目名称:group07-tran-stifter,代码行数:7,代码来源:ParticleColliderOnSystem.cs

示例3: OnDied

	void OnDied(GameObject enemy)
	{
		if (enemy.Equals (gameObject)) 
		{
			innerRotate.StopSmooth();
			outterRotate.StopSmooth();

			if(dropMinionsOnDeath)
			{
				foreach(Transform t in transform.FindChild("Minions"))
				{
					t.parent = transform.parent;

					foreach(EnemyMovement enemyMovement in t.GetComponents<EnemyMovement>())
					{
						if(enemyMovement.GetType() == typeof(RandomMovement))
							enemyMovement.enabled = true;
						else
							enemyMovement.enabled = false;
					}

					//collider was disabled when parent changed
					t.GetComponentInChildren<Collider2D>().enabled = true;

					if(OnMinionReleased != null)
						OnMinionReleased(t.gameObject);
				}
			}
			else
			{
				RemoveMinions();
			}
		}
	}
开发者ID:OvertimeStudios,项目名称:CreepyBuster,代码行数:34,代码来源:Legion.cs

示例4: leavePoop

 public void leavePoop(GameObject collectable)
 {
     if (collectable.Equals (currentCollectable))
     {
         onPoop = false;
         currentCollectable = null;
     }
 }
开发者ID:robsolomon,项目名称:PartyPoopers,代码行数:8,代码来源:DogController.cs

示例5: OnDestroyChild

 void OnDestroyChild(GameObject target)
 {
     if (target.Equals(maxCautionEnemy))
     {
         maxCautionEnemy = null;
         if(ui)ui.BroadcastMessage("OnUpdateCaution", 0, SendMessageOptions.DontRequireReceiver);
     }
 }
开发者ID:negimochi,项目名称:EchoHiker,代码行数:8,代码来源:CautionUpdater.cs

示例6: updateSelector

 public void updateSelector(GameObject newText)
 {
     // Gets called from the text itself to tell this script a mouse is pointing at it.
     for (int i = 0; i < selectedArray.Length; i++) {
         if ( newText.Equals (selectedArray[i])) {
             selectNum = i;
             changeSelector ();
         }
     }
 }
开发者ID:kodylaseter,项目名称:Geocentric,代码行数:10,代码来源:selectionScript.cs

示例7: otherCollisionEnter

 public override void otherCollisionEnter(GameObject enemy,Vector3 point)
 {
     if(enemy.GetComponent<HydraPlatform>()!=null){
         enemy.GetComponent<HydraPlatform>().hasBeenTouched();
         if(iaParent.platformDestroyed !=null && !enemy.Equals(iaParent.platformDestroyed)){
             iaParent.platformDestroyed.GetComponent<HydraPlatform>().repositionPlatform();
         }
         iaParent.platformDestroyed = enemy;
     }
 }
开发者ID:JosepFloriach,项目名称:LightguardLegacy,代码行数:10,代码来源:HydraAppearAttack.cs

示例8: hasConnectingPath

	public bool hasConnectingPath(GameObject node)
	{
		foreach (GameObject path in connectedPaths)
		{
			if (node.Equals(path))
			{
				return true;
			}
		}
		return false;
	}
开发者ID:mezosaurus,项目名称:eae-project,代码行数:11,代码来源:PathNode.cs

示例9: GetRandomDestination

 public GameObject GetRandomDestination(GameObject current)
 {
     bool foundDest = false;
     GameObject go = null;
     while(!foundDest){
         int i = Random.Range (0, navPoints.Length);
         go = navPoints[i];
         foundDest = (go.GetComponent<NavpointScript>().isDestination && !current.Equals (go));
     }
     return go;
 }
开发者ID:RandomGuy928,项目名称:GD1P4_SeriousFix,代码行数:11,代码来源:NavmanagerScript.cs

示例10: isItemTouchingInventory

 public bool isItemTouchingInventory(GameObject itemToCheck)
 {
     foreach(GameObject item in itemInInventoryTrigger)
     {
         if(itemToCheck.Equals(item))
         {
             return true;
         }
     }
     return false;
 }
开发者ID:NoDruid,项目名称:Zerblobbung,代码行数:11,代码来源:InventoryHandler.cs

示例11: isItemStoredInInventory

    public bool isItemStoredInInventory(GameObject itemToCheck)
    {
        foreach(ItemParentSave item in itemInInventory)
        {
            if(itemToCheck.Equals(item.ItemGameObject))
            {
                return true;
            }
        }

        return false;
    }
开发者ID:NoDruid,项目名称:Zerblobbung,代码行数:12,代码来源:InventoryHandler.cs

示例12: getParentFromItem

    public Transform getParentFromItem(GameObject itemToCheck)
    {
        foreach(ItemParentSave item in itemInInventory)
        {
            if(itemToCheck.Equals(item.ItemGameObject))
            {
                return item.parent;
            }
        }

        return null;
    }
开发者ID:NoDruid,项目名称:Zerblobbung,代码行数:12,代码来源:InventoryHandler.cs

示例13: ShootTarget

    public void ShootTarget(GameObject target)
    {
        if(!target.Equals(targetCharacter))
        {
            if(OnBeginAttacking != null)
                OnBeginAttacking(target);

            StopCoroutine("castShot");
            targetCharacter = target;
            StartCoroutine("castShot");
        }
    }
开发者ID:WondermSwift,项目名称:unity_moba_sandbox,代码行数:12,代码来源:Attacker.cs

示例14: Bounce

 public void Bounce(GameObject bounce)
 {
     if (bounce.Equals(bouncePointer1)) {
         bouncePointer2.SetActive(true);
         bouncePointer1.SetActive(false);
         realDeepThroat.destination = bouncePointer2.transform.position;
     } else {
         bouncePointer1.SetActive(true);
         bouncePointer2.SetActive(false);
         realDeepThroat.destination = bouncePointer1.transform.position;
     }
 }
开发者ID:unclehighbrow,项目名称:Math-Is-Stupid,代码行数:12,代码来源:TutorialManager.cs

示例15: MoveToward

 public void MoveToward(GameObject targetCharacter)
 {
     if(!targetCharacter.Equals(moveTarget))
     {
         moveTarget = targetCharacter;
         MoveTo(targetCharacter.transform.position);
     }
     else
     {
         moveTargetPosition = targetCharacter.transform.position;
         //moveTargetPosition.z = 0;
     }
 }
开发者ID:WondermSwift,项目名称:unity_moba_sandbox,代码行数:13,代码来源:Navigator.cs


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