/// <summary> /// 首先判断场景模式: /// 普通场景 /// 网络场景 /// </summary> /// <returns><c>true</c> if is enemy the specified a b; otherwise, <c>false</c>.</returns> /// <param name="a">The alpha component.</param> /// <param name="b">The blue component.</param> public static bool IsEnemy(GameObject a, GameObject b) { var scene = WorldManager.worldManager.GetActive(); if (scene.IsNet) { //var battr = NetworkUtil.GetAttr(b); return(scene.IsEnemy(a, b)); /* * if (a != b) * { * return true; * } else * { * return false; * } */ } var enemyTag = SkillLogic.GetEnemyTag(a.tag); if (b.tag == enemyTag) { return(true); } return(false); }
/// <summary> /// 首先判断场景模式: /// 普通场景 /// 网络场景 /// </summary> /// <returns><c>true</c> if is enemy the specified a b; otherwise, <c>false</c>.</returns> /// <param name="a">The alpha component.</param> /// <param name="b">The blue component.</param> public static bool IsEnemy(GameObject a, GameObject b) { var scene = WorldManager.worldManager.GetActive(); if (scene.IsNet) { return(scene.IsEnemy(a, b)); } var enemyTag = SkillLogic.GetEnemyTag(a.tag); if (b.tag == enemyTag) { return(true); } return(false); }