// Use this for initialization public SoloEngage(Ship inShip) { ship = inShip; if (ship == null || ship.target == null) { return; } leader = inShip.getFleetLeader(); predictTarget = new PositionPrediction(inShip); RandomPsuedoUpVector(); if(ship.photonView.isMine) ship.photonView.RPC("SoloEngageRPC", PhotonTargets.Others, psuedoUpVector, ship.target.GetComponent<PhotonView>().viewID); }
public TeamEngage(Ship inShip) { ship = inShip; leader = inShip.getFleetLeader(); if (ship != leader) ship.SetTargetTransform(leader.GetTarget()); predictTarget = new PositionPrediction(inShip); if (leader.target == null) { LeaderChecks(); } if(ship.photonView.isMine && leader.target != null) { RandomPsuedoUpVector(); ship.photonView.RPC("TeamEngageRPC", PhotonTargets.Others, psuedoUpVector, ship.fleetLeader.target.GetComponent<PhotonView>().viewID); } }
// Use this for initialization public SearchFollow(Ship inShip) { // if (ship.isFleetLeader) // { // //Debug.Log("Is Fleet Leader"); // //Debug.LogWarning("Hot Swapping Fleet Leader in SearchFollow"); // ship.SetBehavior(new Search(ship)); // return; // } ////Debug.Log(inShip.gameObject.name + " is now following " + ship.getFleetLeader().gameObject.name); ship = inShip; //Debug.Log("Setting Target, Should be fleet leader."); target = ship.getFleetLeader().transform; //Debug.Log("Sending RPC to Searchfollow"); if(ship.photonView.isMine) ship.photonView.RPC("SearchFollowRPC", PhotonTargets.Others, null); }
// Use this for initialization public MultiSoloEngage(Ship inShip) { ship = inShip; leader = inShip.getFleetLeader(); predictTarget = new PositionPrediction(inShip); }