Пример #1
0
        public AnelGuerreiro(GameObject spawnPosition)
        {
            GameObject spriteGameObject = Instantiate <GameObject>(spawnPosition);

            SpriteItem = spriteGameObject.GetComponent <SpriteRenderer>();
            Texture2D textureHelmo = Resources.Load <Texture2D>("SetWarrior/Icons/Hand/Finger/Guerreiro");
            Sprite    mySprite     = Sprite.Create(textureHelmo, new Rect(0.0f, 0.0f, textureHelmo.width, textureHelmo.height), new Vector2(0.0f, 0.0f), 100.0f);

            SpriteItem.sprite       = mySprite;
            SpriteItem.sortingOrder = 1;

            BoxCollider2D boxColliderSprite = spriteGameObject.GetComponent <BoxCollider2D>();

            boxColliderSprite.offset = new Vector2(0.9557155f, 0.9581932f);
            boxColliderSprite.size   = new Vector2(1.903571f, 1.897903f);
            spriteGameObject.tag     = "equipavel";

            AnelGuerreiro component = spriteGameObject.AddComponent <AnelGuerreiro>();

            component.Nome       = Nome;
            component.Tipo       = Tipo;
            component.bodyPart   = bodyPart;
            component.Classe     = Classe;
            component.SpriteItem = SpriteItem;
        }
Пример #2
0
        public Item DeepCopy()
        {
            AnelGuerreiro other = (AnelGuerreiro)this.MemberwiseClone();

            return(other);
        }