Ejemplo n.º 1
0
        public BotaGuerreiro(GameObject spawnPosition)
        {
            GameObject spriteGameObject = Instantiate <GameObject>(spawnPosition);

            SpriteItem = spriteGameObject.GetComponent <SpriteRenderer>();
            Texture2D textureHelmo = Resources.Load <Texture2D>("SetWarrior/Icons/Foot/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";

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

            component.Nome       = Nome;
            component.Tipo       = Tipo;
            component.bodyPart   = bodyPart;
            component.Classe     = Classe;
            component.SpriteItem = SpriteItem;
            component.STR        = 6;
            component.AGI        = 14;
            component.DEX        = 23;
            component.LUK        = 5;
            component.Peso       = 9;
        }
Ejemplo n.º 2
0
        public Item DeepCopy()
        {
            BotaGuerreiro other = (BotaGuerreiro)this.MemberwiseClone();

            return(other);
        }