コード例 #1
0
 public LameShip getShip()
 {
     if (ship == null)
     {
         ship = GetComponentInParent <LameShip>();
     }
     return(ship);
 }
コード例 #2
0
    void OnCollisionExit(Collision collisionInfo)
    {
        LameShip ship = collisionInfo.gameObject.GetComponentInParent <LameShip>();

        //Just do not take damage if player is docked
        if (ship != null)
        {
            if (ship.DockingPort != null)
            {
                modHP(Mathf.Round(collisionInfo.relativeVelocity.magnitude * CollisionDamage));
            }
            //meh, docking to anything it's fine.
        }
    }
コード例 #3
0
    public Transform[] getPoints()
    {
        LameShip ship = PlayerControls.getPlayerShip();

        Transform[] points = null;

        if (ship != null)
        {
            return(ship.hardPoints);
        }

        //return gun controller if no points assigned

        points    = new Transform[1];
        points[0] = this.transform;

        return(points);
    }
コード例 #4
0
    public bool isOnPlayerShip()
    {
        LameShip       ship   = GetComponentInParent <LameShip>();
        PlayerControls player = PlayerControls.GetActivePlayer();

        if (player != null)
        {
            if (player.activeVessel == ship)
            {
                return(true);
            }

            if (ship.pilot == LameShip.shipController.player)
            {
                return(true);
            }
        }

        return(false);
    }
コード例 #5
0
 public static bool areFriendly(LameShip shipA, LameShip shipB)
 {
     return(!shipA.isHostile(shipB));
 }
コード例 #6
0
 public static bool areHostile(LameShip shipA, LameShip shipB)
 {
     return(shipA.isHostile(shipB));
 }
コード例 #7
0
 public bool isFriendly(LameShip mobToCheck)
 {
     return(!isHostile(mobToCheck.iff));
 }
コード例 #8
0
    //public bool isFriendly(int iffCode)
    //{
    //    return false;
    //}

    public bool isHostile(LameShip mobToCheck)
    {
        return(isHostile(mobToCheck.iff));
    }