Ejemplo n.º 1
0
 /// <summary>
 /// check if the target gameobject is on the same team as the player.
 /// </summary>
 /// <param name="input"></param>
 /// <returns></returns>
 GameObject isalliedtarget(GameObject input)
 {
     if (UnitMovementcommandcontroller.getteam(input.GetComponent <_Ship>().ShipColor, unitcon.crosslevelholder.Gamemode) == UnitMovementcommandcontroller.getteam(unitcon.team, unitcon.crosslevelholder.Gamemode))
     {
         return(pulsewave);
     }
     else
     {
         return(pulsewavered);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 // checks if target is in range and the same team.
 /// <summary>
 void fireweaponcheckshield()
 {
     if (TSVector.Distance(parentscript.WeaponTarget.GetComponent <TSTransform>().position, parentscript.fac.transformts.position) < Range && UnitMovementcommandcontroller.getteam(parentscript.WeaponTarget.shipscript.ShipColor, unittargetcontrol.crosslevelholder.Gamemode) == UnitMovementcommandcontroller.getteam(parentscript.ShipColor, unittargetcontrol.crosslevelholder.Gamemode))
     {
         fireweapon(parentscript.WeaponTarget.transform.position);
     }
     else
     {
         parentscript.WeaponTarget = null;
     }
 }