コード例 #1
0
    protected override void UseSpecial()
    {
        if (this.SpecialAmmo > 0)
        {
            this.PlayThrowLightSound(0.4f);
            this.SpecialAmmo--;
            gunSprite.GetComponent <Renderer>().material.mainTexture = gunTextureNoShield;
            if (base.IsMine)
            {
                //Main.Log("spawning");
                //ProjectileController.SpawnProjectileOverNetwork(this.boomerang, this, base.X + base.transform.localScale.x * 6f, base.Y + 15f, base.transform.localScale.x * this.boomerangSpeed, 0f, false, base.playerNum, false, false, 0f);
                Shield newProj = ProjectileController.SpawnProjectileLocally(this.shield, this, base.X + base.transform.localScale.x * 6f, base.Y + 8, base.transform.localScale.x * this.boomerangSpeed, 0f, false, base.playerNum, false, false, 0f) as Shield;
                //newProj.Display();
                //Main.Log("arguments: " + (base.X + base.transform.localScale.x * 6f) + "   " + (base.Y + 8) + "   " + (base.transform.localScale.x * this.boomerangSpeed) + "   " + 0f);
                //shield.gameObject.SetActive(true);
                //shield.Fire(base.X + base.transform.localScale.x * 6f, base.Y + 8, base.transform.localScale.x * this.boomerangSpeed, 0f, 0f, base.playerNum, this);

                //shield.gameObject.SetActive
                BoxCollider tempAttachBoxCollider = BoxCollider.Instantiate(attachBoxCollider);
                //Transform tempShieldTransform = Transform.Instantiate(shieldTransform);
                Transform   tempShieldTransform = newProj.transform;
                SoundHolder tempSoundHolder     = SoundHolder.Instantiate(boomerangSoundHolder);

                newProj.Setup(tempAttachBoxCollider, tempShieldTransform, tempSoundHolder, rotationSpeed, true);
                newProj.activeProjectile = true;
                //Main.Log("spawned");
            }
        }
        else
        {
            HeroController.FlashSpecialAmmo(base.playerNum);
            this.ActivateGun();
        }
        this.pressSpecialFacingDirection = 0;
    }
コード例 #2
0
 public SearchSamples()
 {
     _soundHolder = new SoundHolder(GetOutputFolder());
     PopulateSoundItemList();
     InitializeComponent();
     MainItemsList.ItemsSource = _soundItemsToShow;
 }
コード例 #3
0
 public void Activate(Color teamcolor, SoundHolder deathSoundHolder, Vector3 pos)
 {
     spriteRendererTeamcolor.color = teamcolor;
     this.deathSoundHolder         = deathSoundHolder;
     transform.position            = pos;
     gameObject.SetActive(true);
 }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        keyMenager = GameObject.Find("KeyMenager").GetComponent <KeyMenager>();

        gm          = GameObject.FindGameObjectWithTag("GameMaster");
        soundholder = GameObject.Find("SoundHolder").GetComponent <SoundHolder>();
        bindkey     = gameObject.GetComponent <BindKey>();


        DefaultUI.SetActive(false);

        bindkeyUI = false;

        ResolutionScroll = false;
        QualityScroll    = false;
        //kategorie poziomu trundości
        category[0].SetActive(true);
        category[1].SetActive(false);
        category[2].SetActive(false);
        category[3].SetActive(false);

        load();

        if (gm != null)
        {
            gm.GetComponent <Game_Master>().settings = this;
        }
        SettingUI.SetActive(false);
    }
コード例 #5
0
    public static void LoadAssets()
    {
        PlayerHolder.Initialize();
        EnemyHolder.Initialize();
        WeaponHolder.Initialize();
        AmmunitionDropHolder.Initialize();
        ProjectileHolder.Initialize();
        SoundHolder.Initialize();
        VisualEffectHolder.Initialize();
        AnimationHolder.Initialize();
        MapHolder.Initialize();

        OnLoadingStatus += PlayerHolder.CurrentLoadingPercentage;
        OnLoadingStatus += EnemyHolder.CurrentLoadingPercentage;
        OnLoadingStatus += WeaponHolder.CurrentLoadingPercentage;
        OnLoadingStatus += ProjectileHolder.CurrentLoadingPercentage;
        OnLoadingStatus += SoundHolder.CurrentLoadingPercentage;
        OnLoadingStatus += VisualEffectHolder.CurrentLoadingPercentage;
        OnLoadingStatus += AnimationHolder.CurrentLoadingPercentage;
        OnLoadingStatus += AmmunitionDropHolder.CurrentLoadingPercentage;
        OnLoadingStatus += MapHolder.CurrentLoadingPercentage;

        PlayerHolder.LoadAssets();
        EnemyHolder.LoadAssets();
        WeaponHolder.LoadAssets();
        ProjectileHolder.LoadAssets();
        SoundHolder.LoadAssets();
        VisualEffectHolder.LoadAssets();
        AnimationHolder.LoadAssets();
        AmmunitionDropHolder.LoadAssets();
        MapHolder.LoadAssets();
    }
コード例 #6
0
    void Start()
    {
        soundholder           = GameObject.Find("SoundHolder").GetComponent <SoundHolder>();
        KeyMenager            = GameObject.Find("KeyMenager").GetComponent <KeyMenager>();
        soundholder.isloading = true;

        if (PlayerPrefs.HasKey("beforeBorders0")) //sprawdza czy została przekroczona granica stage'ow
        {
            prevBorders[0] = PlayerPrefs.GetInt("beforeBorders0");
            prevBorders[1] = PlayerPrefs.GetInt("beforeBorders1");
        }
        else
        {
            prevBorders[0] = 0;
            prevBorders[1] = 0;
        }

        StageInfo();

        Cursor.lockState = CursorLockMode.Locked; //Zablokowanie kursora myszy.
        Cursor.visible   = false;                 //Ukrycie kursora.

        if (sceneToLoad < 0)
        {
            return;
        }

        currentScene = SceneManager.GetActiveScene();
        StartCoroutine(LoadAsync(sceneToLoad, anim));

        Debug.Log("Loading....");
    }
コード例 #7
0
ファイル: Game_Master.cs プロジェクト: Mescruu/TheGame
    //static public GameObject powerUI;

    void Start()
    {
        //początkowe wartości
        PlayerFighting = false;
        ChangeToZero   = true;
        YouGetBoard.SetActive(false);
        YouGet.text = " ";
        for (int i = 0; i < note.Length; i++)
        {
            note[i] = 0;
        }
        LevelId = Application.loadedLevel;
        save    = gameObject.GetComponent <Saveing>();
        DeadScreenImage.SetActive(false);

        NewLevelInstantiate = false;

        // data = gameObject.GetComponent<itemDataBase>();
        awake = true;

        soundHolder = GameObject.Find("SoundHolder").GetComponent <SoundHolder>();
        keyMenager  = GameObject.Find("KeyMenager").GetComponent <KeyMenager>();

        soundHolder.isloading = true;

        eq = GameObject.Find("Equipment").GetComponent <CanvasEkwipunek>();

        saving    = false;
        loadScene = false;

        player           = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Controller>();
        playerAtckScript = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAttack>();

        loadScript = gameObject.GetComponent <LoadTargetScript>();

        itd = gameObject.GetComponent <itemDataBase>();
        Debug.Log("itd nie jest null");

        save.Load();
        itemDataBaseChest = gameObject.GetComponent <itemDataBaseChest>();

        if (itemDataBaseChest != null) //jezeli znajduje się skrzynia na planszy
        {
            Debug.Log("itemDataBaseChest nie jest null");
            save.ChestLoad(LevelId);
        }

        RefreshEqStats();

        soundHolder.isloading = false;

        if (PlayerPrefs.HasKey("difficultLevel")) //załadowanie poziomu trudności
        {
            difficultLevel = PlayerPrefs.GetInt("difficultLevel");
        }
        settings.load(); //załadowanie ustawień

        exp_Slider = GameObject.Find("SkillUI").GetComponent <Exp_Slider>();
    }
コード例 #8
0
        public MainWindow()
        {
            _soundHolder = new SoundHolder(GetOutputFolder());

            InitializeComponent();

            ConvertTagsToList();
            PopulateSoundItemList();

            DisplayedItemsGrid.ItemsSource = _soundItemsToShow;
            Tag.ItemsSource = _tags;
        }
コード例 #9
0
        public void Reload()
        {
            if (this.Ammo != this.MagazineSize && this.Reloading != true)
            {
                Sound sound = SoundHolder.GetInstance().Get(SoundIdentifier.Reload);
                sound.Volume = SoundVolume.GetInstance().GetVolume();
                sound.Play();

                this.ChangeAmmo(-this.Ammo);
                this.ReloadTimer.Restart();
                this.Reloading = true;
            }
        }
コード例 #10
0
        public void PlayRawSound(string soundPath, float volume = 1f)
        {
            //Retrieve next sound holder, then assign the sound ID to the holder
            SoundHolder holder = NextAvailableSound();

            holder.SetSound(soundPath, true);
            holder.SetVolume(volume);

            //Play the sound
            holder.Play();

            UpdateLastSoundTimer();
        }
コード例 #11
0
        public void ShouldAddItemToList()
        {
            SoundHolder   sh  = new SoundHolder();
            SoundItemData sid = new SoundItemData
            {
                Name = "Added item"
            };

            sh.Add(sid);

            sh.SoundItems.Should().HaveCount(1);
            sh.SoundItems[0].Name.Should().Be("Added item");
        }
コード例 #12
0
ファイル: Sound.cs プロジェクト: johnfriedrich/RomanDefenders
 public void PlaySoundClipWithSource(SoundHolder soundHolder, AudioSource source, float duration)
 {
     foreach (SoundData data in soundClips)
     {
         if (data.name == soundHolder.SoundName)
         {
             source.clip = data.clip;
             source.PlayOneShot(source.clip, soundHolder.SoundVolumeMultiplier);
             if (duration > 0)
             {
                 StartCoroutine(PlayForDuration(duration, source));
             }
         }
     }
 }
コード例 #13
0
 public void Setup(SpriteSM attachSprite, Player attachPlayer, int attachplayerNum, Shield attachShield,
                   SoundHolder attachSoundHolder, float attachFireRate)
 {
     sprite                   = attachSprite;
     player                   = attachPlayer;
     playerNum                = attachplayerNum;
     shield                   = attachShield;
     soundHolder              = attachSoundHolder;
     this.SpecialAmmo         = 1;
     this.originalSpecialAmmo = 1;
     this.fireRate            = attachFireRate;
     this.health              = 1;
     this.canChimneyFlip      = true;
     this.doRollOnLand        = true;
     this.useNewFrames        = true;
 }
コード例 #14
0
ファイル: Sound.cs プロジェクト: johnfriedrich/RomanDefenders
 public void PlaySoundClipWithSource(SoundHolder soundHolder, AudioSource source, float duration, bool loop)
 {
     if (loop)
     {
         foreach (SoundData data in soundClips)
         {
             if (data.name == soundHolder.SoundName)
             {
                 source.clip = data.clip;
                 source.loop = loop;
                 source.Play();
             }
         }
         return;
     }
     PlaySoundClipWithSource(soundHolder, source, duration);
 }
コード例 #15
0
        private SoundHolder NextAvailableSound()
        {
            //Check for available sounds
            for (int i = 0; i < Sounds.Count; i++)
            {
                if (Sounds[i].IsPlaying == false)
                {
                    return(Sounds[i]);
                }
            }

            //If no sounds are available, create a new sound holder and add it to the list
            SoundHolder newHolder = new SoundHolder();

            Sounds.Add(newHolder);
            return(newHolder);
        }
コード例 #16
0
        public void PlaySound(Sound sound, float volume = 1f)
        {
            if (SoundMap.ContainsKey(sound) == false)
            {
                Debug.LogError($"Cannot play sound {sound} because it doesn't exist in {nameof(SoundMap)}!");
                return;
            }

            //Retrieve next sound holder, then assign the sound ID to the holder
            SoundHolder holder = NextAvailableSound();

            holder.SetSound(sound);
            holder.SetVolume(volume);

            //Play the sound
            holder.Play();

            UpdateLastSoundTimer();
        }
コード例 #17
0
        public void ShouldNotHaveSameItemTwice()
        {
            SoundHolder   sh  = new SoundHolder();
            SoundItemData sid = new SoundItemData
            {
                Name     = "Added item",
                FullPath = @"C:\FullPath\Wav.wav"
            };

            sh.Add(sid);

            SoundItemData sidTwo = new SoundItemData
            {
                Name     = "Added item Different name",
                FullPath = @"C:\FullPath\Wav.wav"
            };

            sh.Add(sidTwo);

            sh.SoundItems.Should().HaveCount(1);
            sh.SoundItems[0].Name.Should().Be("Added item");
        }
コード例 #18
0
 public EntitySaveData(OwnerEnum owner, ParentObjectNameEnum objectName, EntityStateEnum entityState, int maxLevel, int currentLevel, float maxHealthpoints, float currentHealthPoints, int buildCost, int buildTime, float armor, EntityActionStateEnum entityActionState, EntityBehaviourEnum entityBehaviour, float baseDamage, float movementSpeed, float viewDistance, float attackRange, float attackDelay, int foodValue, SoundHolder dieSoundHolder, SoundHolder fightSoundHolder, int experience)
 {
     this.owner               = owner;
     this.objectName          = objectName;
     this.entityState         = entityState;
     this.maxLevel            = maxLevel;
     this.currentLevel        = currentLevel;
     this.maxHealthpoints     = maxHealthpoints;
     this.currentHealthPoints = currentHealthPoints;
     this.buildCost           = buildCost;
     this.buildTime           = buildTime;
     this.armor               = armor;
     this.entityActionState   = entityActionState;
     this.entityBehaviour     = entityBehaviour;
     this.baseDamage          = baseDamage;
     this.movementSpeed       = movementSpeed;
     this.viewDistance        = viewDistance;
     this.attackRange         = attackRange;
     this.attackDelay         = attackDelay;
     this.foodValue           = foodValue;
     this.dieSoundHolder      = dieSoundHolder;
     this.fightSoundHolder    = fightSoundHolder;
     this.experience          = experience;
 }
コード例 #19
0
    public void Setup(BoxCollider attachBoomerangCollider, Transform attachTransform, SoundHolder attachSoundHolder, float attachRotationSpeed, bool startRunning)
    {
        this.boomerangCollider = attachBoomerangCollider;
        base.transform.parent  = attachTransform;
        this.soundHolder       = attachSoundHolder;
        //this.rotationSpeed = attachRotationSpeed;
        this.returnTime    = 2f;
        this.rotationSpeed = 0f;
        this.damage        = 3;
        this.texture       = this.gameObject.GetComponent <AnimatedTexture>();

        base.transform.localScale = new Vector3(1f, 1f, 1f);

        base.transform.eulerAngles = new Vector3(0f, 0f, 0f);

        this.enabled = startRunning;

        //texture.paused = true;
        //Main.Log("request frame: " + Main.requestedFrame);
        this.texture.frames = 1;
        //this.texture.SetFrame(Main.requestedFrame);

        if (this.gameObject == null)
        {
            Main.Log("gameobject null");
        }
        if (this.boomerangCollider == null)
        {
            Main.Log("collider null");
        }
    }
コード例 #20
0
    //public AudioClip TankMachineGun;
    //public AudioClip RocketLauncher;
    //Defesas

    /*
     * public AudioClip bulletsHit;
     * public AudioClip bulletsOnHardHit;
     * public AudioClip shellHit;
     * public AudioClip heroicTarget;
     * public AudioClip bulletMiss;
     * public AudioClip shellMiss;
     * public AudioClip artilleryHit;
     */
    void Start()
    {
        instancia = this;
    }
コード例 #21
0
        protected override void LoadContent()
        {
            //Initialize the GameInfo:
            GameInfo.RefSpriteBatch   = spriteBatch;
            GameInfo.RefDevice        = Device;
            GameInfo.RefDeviceManager = graphics;
            GameInfo.RefContent       = Content;

            //Initialize some more static classes:
            TextureHolder.Initialize();
            SoundHolder.Initialize();
            MouseManager.Initialize();

            //Initalize the grid:
            Grid grid      = new Grid(new Vector2(0, 0), 100, 40);
            Grid gridFloor = new Grid(new Vector2(0, 0), 100, 40);

            ObjectHolder.Create(grid);
            ObjectHolder.Create(gridFloor);

            //Initialize the camera:
            Camera.Initialize(new Vector2(0, 0));

            //Initialize default sprites:
            TextureHolder.DefaultTextures[typeof(DungeonWall)]   = TextureHolder.AddTexture("DungeonWall");
            TextureHolder.DefaultTextures[typeof(DungeonFloor)]  = TextureHolder.AddTexture("DungeonFloor");
            TextureHolder.DefaultTextures[typeof(DungeonFloor2)] = TextureHolder.AddTexture("DungeonFloor2");
            TextureHolder.DefaultTextures[typeof(Player)]        = TextureHolder.AddTexture("Player");
            TextureHolder.DefaultTextures[typeof(PlayerLegs)]    = TextureHolder.AddTexture("PlayerLegs");
            TextureHolder.DefaultTextures[typeof(PlayerSword)]   = TextureHolder.AddTexture("PlayerSword");
            TextureHolder.DefaultTextures[typeof(CannonBot)]     = TextureHolder.AddTexture("CannonBot");
            TextureHolder.DefaultTextures[typeof(Sink)]          = TextureHolder.AddTexture("Sink");

            //Load sounds:

            //Create game objects:
            gridFloor.CreateFromString( //Make the floor
                new Dictionary <char, Type>()
            {
                { 'f', typeof(DungeonFloor) },
                { 's', typeof(DungeonFloor2) },
                { '.', null }
            },
                new Dictionary <char, GameObject>()
            {
            },
                new string[] {
                "..............",
                ".sfffffffffff.",
                ".ffffffffffff.",
                ".ffffffffffff..........",
                ".fffffffffffffffsfffff.",
                ".fffffffsfffffffffffff.",
                ".fffffffffffffffffffff.",
                ".fffffffffffffffffffff.",
                ".ffffffffffff..........",
                ".fffsffffffff.",
                ".ffffffffffff.",
                ".............."
            });

            grid.CreateFromString(
                new Dictionary <char, Type>()
            {
                { 'w', typeof(DungeonWall) },
                { 'p', typeof(Player) },
                { 'c', typeof(CannonBot) },
                { 's', typeof(Sink) },
                { '.', null }
            },
                new Dictionary <char, GameObject>()
            {
                { '1', new Sink(new Vector2(0, 0), MazeGameEngine.FurnitureDirection.Up) }
            },
                new string[] {
                "wwwwwwwwwwwwww",
                "w............w",
                "w............w",
                "w............wwwwwwwwww",
                "w.....................w",
                "w.....p...............w",
                "w.....................w",
                "w.....................w",
                "w............wwwwwwwwww",
                "w............w",
                "w.....1......w",
                "wwwwwwwwwwwwww"
            });

            //Make a reference to the UI objects: (so that other objects can interact with them)
        }
コード例 #22
0
ファイル: SoundHolder.cs プロジェクト: Shab09/BBBreak
 private void Awake()
 {
     soundHolder = this;
 }
コード例 #23
0
 public void Activate(SoundHolder destroySoundHolder, Vector3 pos)
 {
     this.destroySoundHolder = destroySoundHolder;
     transform.position      = pos;
     gameObject.SetActive(true);
 }
コード例 #24
0
    public void PlaySound(SoundType which)
    {
        SoundHolder sound = sounds[(int)which];

        source.PlayOneShot(sound.clips[Random.Range(0, sound.clips.Length)], sound.volume > 0f? sound.volume : 1f);
    }
コード例 #25
0
 private void Start()
 {
     current = this;
 }
コード例 #26
0
ファイル: AudioData.cs プロジェクト: Mescruu/TheGame
 void Awake() //Na samym początku odszukiwany jest komponent SoundHolder i jego odtwarzacz
 {
     soundHolder            = GameObject.Find("SoundHolder").GetComponent <SoundHolder>();
     soundHolderAudioSource = soundHolder.gameObject.GetComponent <AudioSource>();
 }
コード例 #27
0
ファイル: Main.cs プロジェクト: alexneargarder/BroforceMods
        public static void swapToCustom()
        {
            Dictionary <HeroType, HeroController.HeroDefinition> heroDefinition = Traverse.Create(HeroController.Instance).Field("_heroData").GetValue() as Dictionary <HeroType, HeroController.HeroDefinition>;
            Traverse oldVanDamm = Traverse.Create(HeroController.players[0].character);

            float fireRate = 0.166f;

            bro = HeroController.players[0].character.gameObject.AddComponent <CaptainAmeribro>();
            UnityEngine.Object.Destroy(HeroController.players[0].character.gameObject.GetComponent <WavyGrassEffector>());

            SpriteSM         sprite      = bro.gameObject.GetComponent <SpriteSM>();
            SoundHolder      soundholder = oldVanDamm.Field("soundHolder").GetValue() as SoundHolder;
            TestVanDammeAnim neobro      = HeroController.GetHeroPrefab(HeroType.Nebro);


            // LOADING CHARACTER SPRITE ARMLESS
            {
                string filePath = "D:\\Steam\\steamapps\\common\\Broforce\\Mods\\Development - captainameribro\\captainAmeribroArmless.png";
                var    tex      = new Texture2D(2, 2, TextureFormat.ARGB32, false);
                tex.LoadImage(File.ReadAllBytes(filePath));
                tex.wrapMode = TextureWrapMode.Clamp;

                Texture orig = sprite.meshRender.sharedMaterial.GetTexture("_MainTex");

                tex.anisoLevel = orig.anisoLevel;
                tex.filterMode = orig.filterMode;
                tex.mipMapBias = orig.mipMapBias;
                tex.wrapMode   = orig.wrapMode;

                Material armless = Material.Instantiate(sprite.meshRender.sharedMaterial);
                armless.mainTexture = tex;
                bro.materialArmless = armless;
                //sprite.meshRender.sharedMaterial.SetTexture("_MainTex", tex);
                //bro.materialArmless = sprite.meshRender.sharedMaterial;
            }

            // LOADING CHARACTER SPRITE
            {
                string filePath = "D:\\Steam\\steamapps\\common\\Broforce\\Mods\\Development - captainameribro\\captainAmeribro.png";
                var    tex      = new Texture2D(2, 2, TextureFormat.ARGB32, false);
                tex.LoadImage(File.ReadAllBytes(filePath));
                tex.wrapMode = TextureWrapMode.Clamp;

                Texture orig = sprite.meshRender.sharedMaterial.GetTexture("_MainTex");

                tex.anisoLevel = orig.anisoLevel;
                tex.filterMode = orig.filterMode;
                tex.mipMapBias = orig.mipMapBias;
                tex.wrapMode   = orig.wrapMode;

                sprite.meshRender.sharedMaterial.SetTexture("_MainTex", tex);
                bro.materialNormal = sprite.meshRender.sharedMaterial;
            }


            // LOADING GUN SPRITE WITHOUT SHIELD
            {
                //bro.gunSpriteNoShield = HeroController.players[0].character.gunSprite;

                string filePathGun = "D:\\Steam\\steamapps\\common\\Broforce\\Mods\\Development - captainameribro\\captainAmeribroGunNoShield.png";
                var    texGun      = new Texture2D(2, 2, TextureFormat.ARGB32, false);
                texGun.LoadImage(File.ReadAllBytes(filePathGun));
                texGun.wrapMode = TextureWrapMode.Clamp;

                Texture origGun = neobro.gunSprite.GetComponent <Renderer>().sharedMaterial.GetTexture("_MainTex");

                SpriteSM gunSpriteCopy = SpriteSM.Instantiate(neobro.gunSprite);

                //bro.gunSpriteNoShield.Copy(gunSpriteCopy);

                texGun.anisoLevel = origGun.anisoLevel;
                texGun.filterMode = origGun.filterMode;
                texGun.mipMapBias = origGun.mipMapBias;
                texGun.wrapMode   = origGun.wrapMode;

                bro.gunTextureNoShield = texGun;
            }
            // LOADING GUN SPRITE WITH SHIELD
            {
                bro.gunSprite = HeroController.players[0].character.gunSprite;

                string filePathGun = "D:\\Steam\\steamapps\\common\\Broforce\\Mods\\Development - captainameribro\\captainAmeribroGunWithShield.png";
                var    texGun      = new Texture2D(2, 2, TextureFormat.ARGB32, false);
                texGun.LoadImage(File.ReadAllBytes(filePathGun));
                texGun.wrapMode = TextureWrapMode.Clamp;

                Texture origGun = neobro.gunSprite.GetComponent <Renderer>().sharedMaterial.GetTexture("_MainTex");

                SpriteSM gunSpriteCopy = SpriteSM.Instantiate(neobro.gunSprite);

                bro.gunSprite.Copy(gunSpriteCopy);

                texGun.anisoLevel = origGun.anisoLevel;
                texGun.filterMode = origGun.filterMode;
                texGun.mipMapBias = origGun.mipMapBias;
                texGun.wrapMode   = origGun.wrapMode;

                bro.gunTextureWithShield = texGun;
                bro.gunSprite.GetComponent <Renderer>().material.mainTexture = texGun;
            }


            // PASSING REFERENCES TO NEW PROJECTILE
            Boomerang boom = (HeroController.players[0].character as BroMax).boomerang as Boomerang;

            //Boomerang clone = boom.Clone<Boomerang>();
            foreach (Component comp in boom.GetComponentsInParent(typeof(Component)))
            {
                Main.Log("attached: " + comp.name + " also " + comp.GetType());
            }
            Boomerang clone             = Boomerang.Instantiate(boom);
            Traverse  boomerangTraverse = Traverse.Create(clone);

            //Traverse boomerangTraverseOrig = Traverse.Create(boom);
            //BoxCollider attachBoxCollider = boomerangTraverse.Field("boomerangCollider").GetValue() as BoxCollider;

            //BoxCollider attachBoxCollider = BoxCollider.Instantiate(boomerangTraverse.Field("boomerangCollider").GetValue() as BoxCollider);
            //SoundHolder boomerangSoundHolder = boomerangTraverse.Field("soundHolder").GetValue() as SoundHolder;
            //float rotationSpeed = boomerangTraverse.Field("rotationSpeed").GetValue<float>();
            bro.attachBoxCollider    = BoxCollider.Instantiate(boomerangTraverse.Field("boomerangCollider").GetValue() as BoxCollider);
            bro.boomerangSoundHolder = boomerangTraverse.Field("soundHolder").GetValue() as SoundHolder;
            bro.rotationSpeed        = boomerangTraverse.Field("rotationSpeed").GetValue <float>();
            bro.shieldTransform      = clone.transform.parent;

            UnityEngine.Object.Destroy(clone.gameObject.GetComponent <Boomerang>());


            Shield shield = clone.gameObject.AddComponent <Shield>();

            shield.Setup(bro.attachBoxCollider, bro.shieldTransform, bro.boomerangSoundHolder, bro.rotationSpeed, false);

            //return;
            // LOADING PROJECTILE SPRITE
            //MeshRenderer meshRender = shield.gameObject.GetComponent<MeshRenderer>();
            MeshRenderer meshRender = clone.gameObject.GetComponent <MeshRenderer>();

            //Main.Log("after get component");
            {
                string filePath = "D:\\Steam\\steamapps\\common\\Broforce\\Mods\\Development - captainameribro\\captainAmeribroShield.png";
                var    tex      = new Texture2D(2, 2, TextureFormat.ARGB32, false);
                tex.LoadImage(File.ReadAllBytes(filePath));
                //Main.Log("after load iamge");
                tex.wrapMode = TextureWrapMode.Clamp;

                Texture orig = meshRender.sharedMaterial.mainTexture;

                tex.anisoLevel = orig.anisoLevel;
                tex.filterMode = orig.filterMode;
                tex.mipMapBias = orig.mipMapBias;
                tex.wrapMode   = orig.wrapMode;
                //Main.Log("after orig texture");

                meshRender.material.mainTexture = tex;
                //meshRender.sharedMaterial.mainTexture = tex;
                //Main.Log("at end");
            }


            // PASSING REFERENCES TO NEW VAN DAMM
            bro.Setup(sprite, HeroController.players[0], HeroController.players[0].character.playerNum, shield, soundholder, fireRate);

            UnityEngine.Object.Destroy(HeroController.players[0].character.gameObject.GetComponent <BroMax>());

            //HeroController.players[0].character = bro;

            //Networking.Networking.RPC<int, HeroType, bool>(PID.TargetAll, new RpcSignature<int, HeroType, bool>(bro.SetUpHero), 0, HeroType.BroMax, true, false);
            // Give hero controller reference to new van damm
            bro.SetUpHero(0, HeroType.BroMax, true);

            isCaptainAmeribro = true;
        }