Beispiel #1
0
    /*----------------------------*/

    void Awake()
    {
        po = transform.Find("Cannon").gameObject.GetComponent <PutObject>();
        ec = GetComponent <EnemyController>();
        ec.SetTriggerFunc(BodyEnter, BodyExit, BodyStay, NearEnter, NearExit, NearStay);
        esm = GetComponent <EnemyShotManager>();
    }
Beispiel #2
0
 // Start is called before the first frame update
 void Start()
 {
     tm           = GetComponent <TankMovement>();
     sb           = this.transform.Find("Cannon/ShotBullet").gameObject.GetComponent <ShotBullet>();
     po           = this.transform.Find("Cannon").gameObject.GetComponent <PutObject>();
     gamePadNum   = GetComponent <GamePadManager>().GetGamePadNum();
     countTime[0] = 0f;
     countTime[1] = 0f;
     SkillSet();
     SkillIconSet();
 }
Beispiel #3
0
 private void Start()
 {
     try
     {
         PutObject po = this.transform.Find("Cannon").gameObject.GetComponent <PutObject>();
         po.SetPutAbleLandMineNum(this.putAbleLandMineNum);
     }catch (System.Exception e)
     {
         Debug.Log(e.Message);
     }
 }
Beispiel #4
0
        /// <summary>
        /// Handles the PutObject message of the Store protocol.
        /// </summary>
        /// <param name="header">The message header.</param>
        /// <param name="putObject">The put object message.</param>
        protected override void HandlePutObject(IMessageHeader header, PutObject putObject)
        {
            base.HandlePutObject(header, putObject);

            var uri = this.CreateAndValidateUri(putObject.DataObject.Resource.Uri, header.MessageId);

            if (!uri.IsValid)
            {
                return;
            }
            if (!this.ValidateUriParentHierarchy(uri, header.MessageId))
            {
                return;
            }
            if (!this.ValidateUriObjectType(uri, header.MessageId))
            {
                return;
            }

            try
            {
                var data = putObject.DataObject.GetString();

                if (EtpContentType.Json.EqualsIgnoreCase(uri.ContentType.Format))
                {
                    var objectType = uri.IsRelatedTo(EtpUris.Witsml200) || uri.IsRelatedTo(EtpUris.Eml210)
                        ? ObjectTypes.GetObjectType(uri.ObjectType, uri.Family, OptionsIn.DataVersion.Version200.Value)
                        : ObjectTypes.GetObjectGroupType(uri.ObjectType, uri.Family, uri.Version);

                    var instance = Energistics.Etp.Common.EtpExtensions.Deserialize(objectType, data);
                    data = WitsmlParser.ToXml(instance);
                }

                WitsmlOperationContext.Current.Request = new RequestContext(Functions.PutObject, uri.ObjectType, data, null, null);

                var dataAdapter = Container.Resolve <IEtpDataProvider>(new ObjectName(uri.ObjectType, uri.GetDataSchemaVersion()));
                dataAdapter.Put(putObject.DataObject);

                Acknowledge(header.MessageId);
            }
            catch (ContainerException ex)
            {
                this.UnsupportedObject(ex, putObject.DataObject.Resource.Uri, header.MessageId);
            }
            catch (WitsmlException ex)
            {
                ProtocolException((int)EtpErrorCodes.InvalidObject, $"Invalid object: {ex.Message}; Error code: {(int)ex.ErrorCode}", header.MessageId);
            }
        }
Beispiel #5
0
 private void Awake()
 {
     po = GetComponent <PutObject>();
     ec = transform.root.gameObject.GetComponent <EnemyController>();
 }
Beispiel #6
0
 private void Awake()
 {
     po = GetComponent <PutObject>();
 }
Beispiel #7
0
 public void SetPutter(PutObject po)
 {
     this.po = po;
 }
 private void Awake()
 {
     Instance = this;
     client   = new OssClient(Config.EndPoint, Config.AccessKeyId, Config.AccessKeySecret);
 }