コード例 #1
0
 /// <summary>
 /// Create a model for showing
 /// </summary>
 /// <param name="infoModel">Information about flight</param>
 /// <param name="isReversedFlight">Is flight return</param>
 /// <returns>Information for showing</returns>
 private FlyInfoShow CreateFlyInfoShowModel(FlyInfo infoModel, bool isReversedFlight = false)
 {
     return(new FlyInfoShow
     {
         Arrival = infoModel.Arrival,
         Duration = infoModel.Duration,
         ArrivalTerminal = infoModel.ArrivalTerminal,
         From = infoModel.From,
         ThreadCarrierTitle = infoModel.ThreadCarrierTitle,
         ThreadVehicle = infoModel.ThreadVehicle,
         ThreadNumber = infoModel.ThreadNumber,
         Departure = infoModel.Departure,
         To = infoModel.To,
         IsReservedFlight = isReversedFlight
     });
 }
コード例 #2
0
    //启动空投 成功返回true
    public bool startPlane(FlyInfo dataTemp)
    {
        if(supplyBool==true)
        {
                return false;
        }

        supplyBool=true;
        data=dataTemp;

        if(data.startX<data.endX)
        {
            gameObject.transform.localScale+=new Vector3(0,0,-2*gameObject.transform.localScale.y);
            gameObject.transform.rotation= Quaternion.Euler(0,180, 0);

            //randomNumber=Random.Range(data.startX+10.0f,data.endX-10.0f);
            velocity=data.velocity*1;
        }
        else
        {
            //randomNumber=Random.Range(data.startX-10.0f,data.endX+10.0f);
            velocity=data.velocity*-1;
        }

        _supplyBox = zzCreatorUtility.Instantiate(
            crateToCreate,
            transform.position,
            Quaternion.identity, 0) as GameObject;

        if(Network.peerType!=NetworkPeerType.Disconnected)
            gameObject.networkView.RPC("setTransportedObject", RPCMode.Others, _supplyBox.networkView.viewID);
        //_supplyBox.gameObject.networkView.enabled = false;

        _supplyBox.GetComponent<Rigidbody>().isKinematic = true;
        return true;
    }