本文整理汇总了C#中UnityEngine.BoxCollider2D.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# BoxCollider2D.ToString方法的具体用法?C# BoxCollider2D.ToString怎么用?C# BoxCollider2D.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.BoxCollider2D
的用法示例。
在下文中一共展示了BoxCollider2D.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: doSS
public int skillCooldown = 30; // may not need this... based on interface
#endregion Fields
#region Methods
public void doSS()
{
// Try and get the enemy component. If it is killed and player
// tries to use the ability, handle the null exception.
// Do so by printing a message in the console saying that the
// "Attack Missed". If an enemy is present, get the enemy component.
try
{
enemyObj = GameObject.FindGameObjectWithTag("Enemy");
enemy = enemyObj.GetComponent<Enemy_Reg_AI>();
}
catch (NullReferenceException)
{
Debug.Log("Attack Missed! There are no enemies around.");
}
/**
Two colliders, first is the basic attack collider, the other
is the swinging strike collider. Swinging strike collider is
2.5 times bigger than the basic attack collider. When swinging
strike is activated, the swinging strike collider is activated,
deactivated when "animation" is done (takes about half a second).
**/
//bcolliderObj1 = GameObject.FindGameObjectWithTag("PlayerDamage");
//boxCollider1 = bcolliderObj1.GetComponent<BoxCollider>();
ccolliderObj = GameObject.FindGameObjectWithTag("PlayerDamage");
bCollider = ccolliderObj.GetComponent<BoxCollider2D>();
bCollider.size = new Vector2(2, 2);
//circleCollider.size = new Vector3(3, 3, 1);
StartCoroutine(ColliderResetCooldown()); //reset to originial size
Debug.Log(enemy.ToString());
Debug.Log(bCollider.ToString());
}