• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ObjectType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ObjectType的典型用法代码示例。如果您正苦于以下问题:C# ObjectType类的具体用法?C# ObjectType怎么用?C# ObjectType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ObjectType类属于命名空间,在下文中一共展示了ObjectType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Hero

        public Hero(ObjectType mObjectType, ContentManager content,
            SpriteState defaultState, Vector2 SpritePosition)
            : base(mObjectType, content, defaultState, SpritePosition, Hostility.FRIENDLY)
        {
            mSpriteScale = 0.8f;
            this.mSprite.SpriteScale = mSpriteScale;
            this.hostility = Hostility.FRIENDLY;
            SetUnitAnimation();
            mTarget = SpritePosition;
            mBehaviorHero = new BehaviorHero(1.0f, mTarget);
            mObjectID = mGlobalID;
            mGlobalID++;
            mheroAttribute = new HeroAttribute(this, content);
            SetAttributes();

            int mAttackLevel = (int)HeroAttribute.AttackUpgradeLevel;
            int mDefenseLevel = (int)HeroAttribute.DefenseUpgradeLevel;

            for (int i = 0; i < mAttackLevel; i++)
            {
                mheroAttribute.UpgradeAttack();
            }

            for (int i = 0; i < mDefenseLevel; i++)
            {
                mheroAttribute.UpgradeDefense();
            }
        }
开发者ID:jsandersr,项目名称:SiegeOfDamodred,代码行数:28,代码来源:Hero.cs


示例2: CreateTempFile

        public static async Task<ObjectWriteResult> CreateTempFile(ObjectType type, int length, byte[] data, string rootPath)
        {
            var name = Path.Combine(rootPath, "tmp" + _random.Next(0, int.MaxValue));
            
            using (var file = File.OpenWrite(name))
            using (var stream = CompressionStream.CompressStream(file))
            using (var md = new MessageDigest())
            {
                var header = Encoding.ASCII.GetBytes(string.Format("{0} {1}\0", type.ToTypeCode(), length));

                await stream.WriteAsync(header, 0, header.Length);
                await stream.WriteAsync(data, 0, data.Length);

                md.Update(header);
                md.Update(data);

                var digest = md.Digest();

                return new ObjectWriteResult
                {
                    FileInfo = new FileInfo(name),
                    ObjectId = Helper.ByteArrayToId(digest)
                };
            }
        }
开发者ID:kthompson,项目名称:shard,代码行数:25,代码来源:ObjectWriter.cs


示例3: Camera3D

 public Camera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters, Viewport viewPort)
     : base(id, objectType, transform)
 {
     this.projectionParameters = projectionParameters;
     this.viewPort = viewPort;
 }
开发者ID:TaraMG,项目名称:TeamCyberDyne,代码行数:7,代码来源:Camera3D.cs


示例4: ReadHeader

        private static void ReadHeader(Stream stream, out ObjectType type, out int size)
        {
            size = 0;
            var typeCode = string.Empty;
            var sb = new StringBuilder();
            var inHeader = true;

            while (inHeader)
            {
                var c = (char)stream.ReadByte();
                switch (c)
                {
                    case ' ':
                        typeCode = sb.ToString();
                        sb.Clear();
                        continue;
                    case '\0':
                        size = int.Parse(sb.ToString());
                        sb.Clear();
                        inHeader = false;
                        continue;
                }
                sb.Append(c);
            }

            type = ObjectTypeFromString(typeCode);
        }
开发者ID:kthompson,项目名称:shard,代码行数:27,代码来源:LooseObjectReader.cs


示例5: verifyTarget

    public void verifyTarget(GameObject obj)
    {
        if (_targetType != ObjectType.Unknown)
        {
            if (obj == _target)
            {
                if (hoverObject != null)
                {
                    if (hoverObject.GetComponent<ActionTile>())
                    {
                        Debug.Log("item");
                        hoverObject.GetComponent<ActionTile>().ClickAction(this.gameObject);
                    }
                    if (hoverObject.GetComponent<ActionCharacter>())
                    {
                        Debug.Log("character");
                        hoverObject.GetComponent<ActionCharacter>().ClickAction();
                    }
                    hoverObject = null;
                }
                else
                {
                    Debug.Log("no action possible");
                }

                _targetPos.x = this.transform.position.x;
                _targetPos.y = this.transform.position.y;
                scriptAnim.hasAnim = false;
                this.rigidbody.velocity = new Vector3(0, 0, 0);
                _targetType = ObjectType.Unknown;
            }
        }
    }
开发者ID:Devnithz,项目名称:RPG-1,代码行数:33,代码来源:CharacterMovement.cs


示例6: DrawnActor

 public DrawnActor(string id, ObjectType objectType, Transform3D transform, Effect effect, Color color, float alpha)
     : base(id, objectType, transform)
 {
     this.Effect = effect;
     this.Color = color;
     this.Alpha = alpha;
 }
开发者ID:SongmanW,项目名称:Group-Project-2016-Team-Magia,代码行数:7,代码来源:DrawnActor.cs


示例7: GetObject

 public GameObject GetObject(ObjectType type, Vector3 pos, Quaternion rot)
 {
     
     switch(type)
     {
         case ObjectType.Bullet:
             tempList = BulletList;
         break;
     }
     itemFound = false;
     for(int i = 0; i < tempList.Count; i++)
     {
         if(!tempList[i].activeInHierarchy)
         {
           //  Debug.Log("ItemFound");
             tempList[i].SetActive(true);
             tempObj = tempList[i];
             tempObj.transform.position = pos;
             tempObj.transform.rotation = rot;
             itemFound = true;
             break;
         }
     }
     if(itemFound)
         return tempObj;
     else
         return CreateNewObject(type, pos, rot);
 }
开发者ID:BCRyman,项目名称:CardboardRailShooter,代码行数:28,代码来源:ObjectPooler.cs


示例8: ReadPrefix

        public override int ReadPrefix(string shortSha, out ObjectId id, out UnmanagedMemoryStream data, out ObjectType objectType)
        {
            id = null;
            data = null;
            objectType = default(ObjectType);

            ObjectId matchingKey;

            int ret = ExistsPrefix(shortSha, out matchingKey);

            if (ret != (int)ReturnCode.GIT_OK)
            {
                return ret;
            }

            ret = Read(matchingKey, out data, out objectType);

            if (ret != (int)ReturnCode.GIT_OK)
            {
                return ret;
            }

            id = matchingKey;

            return (int)ReturnCode.GIT_OK;
        }
开发者ID:withzemi1,项目名称:libgit2sharp.voron,代码行数:26,代码来源:VoronOdbBackend.cs


示例9: PrimitiveObject

 public PrimitiveObject(string id, ObjectType objectType,
     Transform3D transform, IVertexData vertexData, Effect effect, Color color, float alpha)
     : base(id, objectType, transform, effect, color, alpha)
 {
     this.vertexData = vertexData;
     this.effect = effect;
 }
开发者ID:SongmanW,项目名称:Group-Project-2016-Team-Magia,代码行数:7,代码来源:PrimitiveObject.cs


示例10: HitObject

 /// <summary>
 /// 构造物件
 /// </summary>
 /// <param name="x1">x坐标</param>
 /// <param name="y1">y坐标</param>
 /// <param name="hitTime1">击打时间</param>
 /// <param name="type1">物件种类</param>
 public HitObject(int x1, int y1, int hitTime1, ObjectType type1)
 {
     x = x1;
     y = y1;
     hitTime = hitTime1;
     type = type1;
 }
开发者ID:VALLIS-NERIA,项目名称:osu,代码行数:14,代码来源:Helpers.cs


示例11: TrackCamera3D

 public TrackCamera3D(string id, ObjectType objectType,
     Transform3D transform, ProjectionParameters projectionParameters,
     Viewport viewPort, Camera3DTrack track)
     : base(id, objectType, transform, projectionParameters, viewPort)
 {
     this.track = track;
 }
开发者ID:TaraMG,项目名称:TeamCyberDyne,代码行数:7,代码来源:TrackCamera3D.cs


示例12: RequestPoolObject

 public GameObject RequestPoolObject(ObjectType type, Vector3 position, Quaternion rotation)
 {
     if(objectPools[type].Count > 0)
     {
         // Get object of the specified kind from the pool
         GameObject obj = objectPools[type].Pop();
         // Set the specified position and rotation
         obj.transform.position = position;
         obj.transform.rotation = rotation;
         // Enable the object
         obj.SetActive(true);
         return obj;
     }
     else if (objectCount < HardSizeLimit)
     {
         // Create new object of the specified type and set it as a child of the pool game object
         GameObject obj = Instantiate (ObjectPrefabs[(int)type]);
         obj.transform.parent = transform;
         // Set the specified position and rotation
         obj.transform.position = position;
         obj.transform.rotation = rotation;
         // Update object count
         ++objectCount;
         return obj;
     }
     else
     {
         throw new System.Exception("Object Pool hard size limit reached. No more pool objects will be instantiated.");
     }
 }
开发者ID:oscarlosu,项目名称:GameDesignProject,代码行数:30,代码来源:ObjectPool.cs


示例13: DisablePoolObject

 public void DisablePoolObject(GameObject obj, ObjectType type)
 {
     // Disable the object
     obj.SetActive(false);
     // Put it in the pool for this kind of object
     objectPools[type].Push(obj);
 }
开发者ID:oscarlosu,项目名称:GameDesignProject,代码行数:7,代码来源:ObjectPool.cs


示例14: ConcreteObject

 protected ConcreteObject(ObjectType objectType, ConcreteObjectBuilder builder)
     : base(objectType, builder)
 {
     m_name = builder.Name;
     m_color = builder.Color;
     m_materialID = builder.MaterialID;
 }
开发者ID:Fulborg,项目名称:dwarrowdelf,代码行数:7,代码来源:ConcreteObject.cs


示例15: ReadObjectHeader

        public long ReadObjectHeader(out ObjectType type)
        {
            if (!IsStartOfStream)
                Rewind();

            long length;

            string typeString = ReadWord().GetString();
            switch (typeString)
            {
                case "blob":
                    type = ObjectType.Blob;
                    break;
                case "commit":
                    type = ObjectType.Commit;
                    break;
                case "tag":
                    type = ObjectType.Tag;
                    break;
                case "tree":
                    type = ObjectType.Tree;
                    break;
                default:
                    throw new ParseException("Unknown type: {0}".FormatWith(typeString));
            }
            length = ReadToNull().Sum(b => b);
            return length;
        }
开发者ID:schacon,项目名称:dotgit,代码行数:28,代码来源:GitObjectReader.cs


示例16: Friendly

        public Friendly(ObjectType mObjectType, ContentManager content,
                        SpriteState defaultState, Vector2 SpritePosition, Vector2 mDefaultTarget, int mAttackLevel, int mDefenseLevel)
            : base(mObjectType, content, defaultState, SpritePosition, Hostility.FRIENDLY)
        {
            this.DefaultTarget = mDefaultTarget;
            this.mCurrentTarget = mDefaultTarget;
            this.hostility = Hostility.FRIENDLY;
            mBehaviorFriendly = new BehaviorFriendly(1.0f);
            mFieldOfViewSize = 300;

            mObjectID = mGlobalID;
            mGlobalID++;
            SetUnitAnimation();

            mFriendlyAttribute = new FriendlyAttribute(this, content);
            if (GameObject.FromSaveGameState == FromSaveGame.NEWGAME)
            {
                SetAttributes();
            }
            this.FriendlyAggroMode = FriendlyAggroMode.MOVING;

            for (int i = 0; i < mAttackLevel; i++)
            {
                mFriendlyAttribute.UpgradeAttack();
            }
            for (int i = 0; i < mDefenseLevel; i++)
            {
                mFriendlyAttribute.UpgradeDefense();
            }
        }
开发者ID:jsandersr,项目名称:SiegeOfDamodred,代码行数:30,代码来源:Friendly.cs


示例17: ItemDropProfile

 public ItemDropProfile(ObjectType p_item, bool p_freeze)
 {
     this.equipmentString = "";
     this.item = p_item;
     this.freezeOnAppear = p_freeze;
     this.chance = 100;
 }
开发者ID:maestun,项目名称:wonderboy,代码行数:7,代码来源:ItemDropProfile.cs


示例18: Texture

 public Texture(string name, Sprite sprite, Bitmap image)
 {
     Sprite = sprite;
     Image = image;
     Name = name;
     Type = ObjectType.Texture;
 }
开发者ID:Sicryption,项目名称:EloBuddyAddons,代码行数:7,代码来源:Texture.cs


示例19: Object

 /// <summary>
 /// Only derived classes should use this constructor. Creates an Object from parameters
 /// </summary>
 /// <param name="objectType">The ObjectType</param>
 /// <param name="bounds">The Rect bounds</param>
 /// <param name="rotation">Object's rotation</param>
 /// <param name="points">Object's list of points</param>
 internal Object(ObjectType objectType, Rect bounds, float rotation, List<Vector2> points)
 {
     ObjectType = objectType;
     Bounds = bounds;
     Rotation = rotation;
     Points = points;
 }
开发者ID:urgamedev,项目名称:UnityFighter2D,代码行数:14,代码来源:Object.cs


示例20: DeleteObject

        /// <summary>
        /// Deletes specified object
        /// </summary>
        /// <param name="objectID">ID of the object to delete</param>
        /// <param name="objectType">Type of the object</param>
        /// <returns>Operation status</returns>
        public DeleteObjectStatus DeleteObject(long objectID, ObjectType objectType)
        {
            string type = ObjectType2String(objectType);
            string result = _service.delete(_apiKey, _token, type, objectID);

            return StatusMessageParser.ParseDeleteObjectStatus(result);
        }
开发者ID:CoderDennis,项目名称:box-csharp-sdk,代码行数:13,代码来源:BoxManager.DeleteObject.cs



注:本文中的ObjectType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ObjectTypes类代码示例发布时间:2022-05-24
下一篇:
C# ObjectStateChangingEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap