示例#1
0
        public EspadaGuerreiro(GameObject spawnPosition)
        {
            GameObject spriteGameObject = Instantiate <GameObject>(spawnPosition);

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

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

            component.Nome       = Nome;
            component.Tipo       = Tipo;
            component.bodyPart   = bodyPart;
            component.Classe     = Classe;
            component.SpriteItem = SpriteItem;
            component.STR        = 15;
            component.AGI        = 10;
            component.DEX        = 5;
            component.LUK        = 5;
            component.Peso       = 9;
        }
示例#2
0
        public Item DeepCopy()
        {
            EspadaGuerreiro other = (EspadaGuerreiro)this.MemberwiseClone();

            return(other);
        }