Exemplo n.º 1
0
        public Scene(RootObject p_rootObject, Player p_player, params Entity[] p_entities)
        {
            tag         = "Scene";
            player      = p_player;
            _rootObject = p_rootObject;
            _collider   = new Collider(p_rootObject);

            entities         = new List <Entity>(p_entities);
            entitiesToRemove = new List <Entity>();

            _playerWeaponManager = new PlayerWeaponManager(p_player);
            _playerWeaponManager.OnLinkSwordDie += _playerWeaponManager_OnLinkSwordDie;
            _enemyWeaponManager = new EnemyWeaponManager();

            SetPortals(RootObjectUtil.GetLayerByName(p_rootObject, "Portals"));
            SetItems(RootObjectUtil.GetLayerByName(p_rootObject, "Items"));
            SetEnemies(RootObjectUtil.GetLayerByName(p_rootObject, "Enemies"));
            SetDoors(RootObjectUtil.GetLayerByName(p_rootObject, "Doors"));
            entities.Add(player);

            portals.ForEach(p_portal => entities.Add(p_portal));
            _enemies.ForEach(p_enemy => entities.Add(p_enemy));

            if (_enemies.Count == 0)
            {
                AllEnemiesDead();
            }

            _worldTileSet  = Main.s_game.Content.Load <Texture2D>("TileSet_World");
            _collisionMask = Main.s_game.Content.Load <Texture2D>("TileSet_CollisionMask");

            SoundManager.instance.Play(World.IsOpenWorld() ? SoundType.OVERWORLD : SoundType.DUNGEON, true);
            SoundManager.instance.StopAndDispose(World.IsOpenWorld() ? SoundType.DUNGEON : SoundType.OVERWORLD);
        }
Exemplo n.º 2
0
    public void Interact()
    {
        PlayerWeaponManager player = FindObjectOfType <PlayerWeaponManager>();

        player.ChangeWeapon(pickupWeapon);
        Destroy(gameObject);
    }
Exemplo n.º 3
0
 private void Start()
 {
     weaponManager = GetComponent <PlayerWeaponManager>();
     rb            = GetComponent <Rigidbody>();
     muzzleFlash.SetActive(false);
     setCurrentWeapon(startingWeapon);
 }
Exemplo n.º 4
0
 protected virtual void Awake()
 {
     health              = GetComponent <Health>();
     weaponManager       = GetComponent <PlayerWeaponManager>();
     crossHair           = GetComponent <CrossHairData>();
     characterController = GetComponent <CharacterController>();
 }
Exemplo n.º 5
0
    //private void Awake()
    private void Init()
    {
        if (IsPlayer)
        {
            PlayerController controller = gameObject.AddComponent <PlayerController>();
            controller.UpperPart = this.UpperPart;

            PlayerWeaponManager playerWeaponManager = gameObject.AddComponent <PlayerWeaponManager>();
            playerWeaponManager.UpperPart          = this.UpperPart;
            playerWeaponManager.BulletVFX          = this.Bullet;
            playerWeaponManager.HitVFX             = this.HitVFX;
            playerWeaponManager.MuzzleVFX          = this.MuzzleVFX;
            playerWeaponManager.InitBulletPosition = this.InitBulletPosition;
            playerWeaponManager.ShootSound         = Shoot;
        }
        else
        {
            EnemyController controller = gameObject.AddComponent <EnemyController>();
            controller.UpperPart = this.UpperPart;

            EnemyWeaponManager enemyWeaponManager = gameObject.AddComponent <EnemyWeaponManager>();
            enemyWeaponManager.UpperPart          = this.UpperPart;
            enemyWeaponManager.BulletVFX          = this.Bullet;
            enemyWeaponManager.HitVFX             = this.HitVFX;
            enemyWeaponManager.MuzzleVFX          = this.MuzzleVFX;
            enemyWeaponManager.InitBulletPosition = this.InitBulletPosition;
            enemyWeaponManager.ShootSound         = Shoot;
        }

        PositionManager positionManager = gameObject.AddComponent <PositionManager>();

        positionManager.SetParameters(this.gameObject);
    }
Exemplo n.º 6
0
 void Awake()
 {
     cM            = GetComponent <characterMove>();
     pI            = GetComponent <PlayerInput>();
     cH            = GetComponent <characterHealth>();
     weaponManager = GetComponent <PlayerWeaponManager>();
 }
Exemplo n.º 7
0
    public void Setup()
    {
        _movement            = m_Instance.GetComponent <PlayerMovement>();
        _playerWeaponManager = m_Instance.GetComponent <PlayerWeaponManager>();

        _movement.playerNum            = playerNum;
        _playerWeaponManager.playerNum = playerNum;
        m_Instance.name = "Palyer  " + playerNum;
    }
    void Start()
    {
        InstantiateMeleeWeapon();
        _playerWeaponManager = gameObject.GetComponentInParent <PlayerWeaponManager>();
        _playerNum           = _playerWeaponManager.playerNum;

        _prevMeleeTime = Time.time;
        _meleeBtn      = "Melee" + _playerNum;
    }
Exemplo n.º 9
0
 private void SetupWeapons()
 {
     _weaponManager = transform.GetComponent <PlayerWeaponManager>();
     if (_weaponManager == null)
     {
         throw new MissingComponentException("No PlayerWeaponManager found on Player object");
     }
     _weaponManager.InitializeWeapon(PlayerNumber, transform.Find(GameConstants.ObjectName_WeaponAnchor));
 }
Exemplo n.º 10
0
    public void Die()
    {
        ////////////////////    Drop all items
        PlayerWeaponManager wm = GetComponent <PlayerWeaponManager>();

        List <GameObject> weapons = wm.weapons;

        ////////////////////    Spawn bodyparts
        foreach (GameObject bodyPart in corpse)
        {
            Instantiate(bodyPart, transform.position + new Vector3(Random.Range(-corpseSpawnOffset, corpseSpawnOffset), Random.Range(-corpseSpawnOffset, corpseSpawnOffset), 0.0f), Quaternion.identity);
        }

        ////////////////////    Explode
        GameObject       thisExplosion = explosion;
        CircleCollider2D thisCollider  = thisExplosion.GetComponent <CircleCollider2D>();
        PointEffector2D  thisEffector  = thisExplosion.GetComponent <PointEffector2D>();

        thisCollider.radius         = explosionRadius;
        thisEffector.forceMagnitude = explosionForce;

        thisExplosion.GetComponent <Explosion>().duration = explosionDuration;

        Instantiate(explosion, transform.position, Quaternion.identity);

        ///////////////////     Self Destruct
        GameObject.FindGameObjectWithTag("PlayerGraphics").SetActive(false);
        GameObject.FindGameObjectWithTag("PlayerJetpack").SetActive(false);
        GetComponent <PlayerMove>().enabled          = false;
        GetComponent <PlayerPickUp>().enabled        = false;
        GetComponent <PlayerAnimControl>().enabled   = false;
        GetComponent <PlayerWeaponManager>().enabled = false;

        GetComponent <Animator>().enabled         = false;
        GetComponent <BoxCollider2D>().enabled    = false;
        GetComponent <CircleCollider2D>().enabled = false;
        GetComponent <Rigidbody2D>().simulated    = false;

        foreach (GameObject weapon in weapons)
        {
            weapon.SetActive(true);
            weapon.GetComponent <WeaponStats>().Drop();
            weapon.GetComponent <WeaponStats>().is_shooting = false;
            weapon.GetComponent <Animator>().SetBool("Shooting", false);
            //Debug.Log("Weapon dropped");
        }

        GameObject.FindGameObjectWithTag("UI").GetComponent <UI_Dead>().Dead();

        //GameObject.FindGameObjectWithTag("Cursor").GetComponent<Cursory>().enabled = false;
        //GameObject.FindGameObjectWithTag("Cursor").GetComponent<SpriteRenderer>().enabled = false;
        //Cursor.visible = true;

        _GM_.playerAlive = false;

        enabled = false;
    }
Exemplo n.º 11
0
    void Start()
    {
        _playerWeaponManager = gameObject.GetComponent <PlayerWeaponManager>();
        _fieldOfViewHelper   = gameObject.GetComponent <FieldOfViewHelper>();

        _playerNum = _playerWeaponManager.playerNum;
        Debug.Log("Player Num : " + _playerNum);
        _prevBulletSpawnTime = Time.time;
        _fireBtn             = "P" + _playerNum + "Attack1";
    }
Exemplo n.º 12
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        if (GUILayout.Button("[Test] Apply Current Weapon"))
        {
            PlayerWeaponManager pWeaponManager = (PlayerWeaponManager)target;
            pWeaponManager.SelectWeapon(pWeaponManager.currentWeapon);
        }
    }
Exemplo n.º 13
0
    void Start()
    {
        playerWeaponManager = GetComponent <PlayerWeaponManager>();
        List <BaseStat> _SwordStats = new List <BaseStat>();

        _SwordStats.Add(new BaseStat(3, "Power", "Your power level."));
        _SwordStats.Add(new BaseStat(2, "Vitality", "Your vitality level."));

        sword = new Item(_SwordStats, "Sword");
    }
 // Use this for initialization
 void Start()
 {
     if (!(rgbd = gameObject.GetComponent <Rigidbody>()))
     {
         rgbd = gameObject.GetComponentInChildren <Rigidbody>();
     }
     playerVelocity = new Vector3();
     coll           = playerBox.GetComponent <Collider>();
     pwm            = GetComponent <PlayerWeaponManager>();
 }
    void Start()
    {
        _playerWeaponManager = gameObject.GetComponent <PlayerWeaponManager>();
        _fieldOfViewHelper   = gameObject.GetComponent <FieldOfViewHelper>();

        _playerNum = _playerWeaponManager.playerNum;
        _remainingBulletInChamber = _bulletNumberinChamber;
        //  Debug.Log("Player Num  in fire : "  + _playerNum);
        _prevBulletSpawnTime = Time.time;
        _fireBtn             = "P" + _playerNum + "Attack1";
    }
Exemplo n.º 16
0
 void MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 17
0
 // Start is called before the first frame update
 void Start()
 {
     _GM_ = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
     _GM_.AddShootingActiveSwitch("UI_Inventory");
     player = _GM_.player;
     pw     = player.GetComponent <PlayerWeaponManager>();
     dm     = player.GetComponent <DeployablesManager>();
     selectPanel.SetActive(false);
     inventoryPanel.SetActive(false);
     resetStatsPanel();
 }
Exemplo n.º 18
0
    public void PickUp(Item item)
    {
        bool remain = false;

        switch (item.type)
        {
        case "Ammo":
            PlayerWeaponManager wm = player.GetComponent <PlayerWeaponManager>();
            wm.ammo_count[wm.ammo_type.IndexOf(item.name)] += Mathf.RoundToInt(item.count);
            items.Remove(item);
            break;

        case "Health":
            PlayerStats ps = player.GetComponent <PlayerStats>();
            ps.health += item.count;
            items.Remove(item);
            break;

        case "Fuel":
            PlayerMove pm       = player.GetComponent <PlayerMove>();
            float      leftover = pm.AddFuel(item.count);
            if (leftover != 0)
            {
                item.count = leftover;
                remain     = true;
            }
            items.Remove(item);
            break;

        case "Module":
            PlayerModuleManager mm = player.GetComponent <PlayerModuleManager>();
            if (mm.InsertModule(item.module) == false)
            {
                remain = true;
            }
            items.Remove(item);
            break;

        case "Weapon":
            GameObject wp = Instantiate((item.obj), transform.position, Quaternion.identity);
            wp.GetComponent <WeaponStats>()._GM_ = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
            wp.GetComponent <WeaponStats>().PickUp(player.GetComponent <PlayerPickUp>().weaponsFolder.transform);
            items.Remove(item);
            break;
        }
        if (remain)
        {
            items.Add(item);
        }

        RefreshSlots();
    }
Exemplo n.º 19
0
    void Start()
    {
        _playerWeaponManager = gameObject.GetComponent <PlayerWeaponManager>();
        _fieldOfViewHelper   = gameObject.GetComponent <FieldOfViewHelper>();

        _playerNum = _playerWeaponManager.playerNum;

        _prevBulletSpawnTime = Time.time;
        // _fireBtn = "P" + _playerNum + "Attack2";
        _fireBtn = "P" + _playerNum + "Attack2";

        // Debug.Log("Raycast " + _fireBtn);
    }
Exemplo n.º 20
0
    protected virtual void Awake()
    {
        damagableTags = new HashSet <string>();
        foreach (string t in DamagableTags)
        {
            damagableTags.Add(t);
        }

        manager = GetComponentInParent <PlayerWeaponManager>();
        if (manager != null)
        {
            spawner = manager.spawner;
        }
    }
Exemplo n.º 21
0
    public void Setup()
    {
        _movement            = m_Instance.GetComponent <PlayerMovement>();
        _playerWeaponManager = m_Instance.GetComponent <PlayerWeaponManager>();
        _schildManager       = m_Instance.GetComponentInChildren <ShieldManager>();


        _movement.playerNum            = playerNum;
        _schildManager.playerNum       = playerNum;
        _playerWeaponManager.playerNum = playerNum;
        m_Instance.name = "Palyer  " + playerNum;

        SetPlayerMatColor();
    }
Exemplo n.º 22
0
    public void InitReferences()
    {
        if (didInit)
        {
            return;
        }

        didInit = true;

        body                = _body;
        sprites             = _sprites;
        playerEffects       = _playerEffects;
        playerHealth        = _playerHealth;
        playerMovement      = _playerMovement;
        playerWeaponManager = _playerWeaponManager;
        artifactManager     = _ArtifactManager;

        playerEffects.InitReferences();

        //ResetSnakeToDefault();
    }
Exemplo n.º 23
0
    public void Access()
    {
        bool remain = false;

        switch (type)
        {
        case "Ammo":
            PlayerWeaponManager wm = GM.GetPlayer().GetComponent <PlayerWeaponManager>();
            wm.ammo_count[wm.ammo_type.IndexOf(name)] += Mathf.RoundToInt(count);
            GM.DisplayText3("Picked up: " + name + " x (" + count + ")", false, 0);
            break;

        case "Deployable":
            bool ant = false;
            foreach (Item _GM_I in GM.GetGM().itemsList)
            {
                if (_GM_I.name == name)
                {
                    Item a = _GM_I;
                    a.count = Mathf.RoundToInt(count);
                    DeployablesManager dm = GM.GetPlayer().GetComponent <DeployablesManager>();
                    dm.dplybles_count[dm.deployables.IndexOf(a.obj)] += (int)a.count;
                    GM.DisplayText3("Picked up: " + name + " GRND x (" + count + ")", false, 0);
                    ant = true;
                    break;
                }
            }
            if (!ant)
            {
                Debug.Log("ERR: Unknown deployable item name");
            }
            break;

        case "Health":
            PlayerStats ps = GM.GetPlayer().GetComponent <PlayerStats>();
            ps.health += count;
            GM.DisplayText3("Health += " + count, false, 0);
            break;

        case "Fuel":
            PlayerMove pm       = GM.GetPlayer().GetComponent <PlayerMove>();
            float      leftover = pm.AddFuel(count);
            if (leftover != 0)
            {
                if (leftover == count)
                {
                    GM.DisplayText3("Maximum fuel capacity reached", false, 0);
                }
                else
                {
                    GM.DisplayText3("Fuel += " + (count - leftover) + "mL", false, 0);
                    count  = leftover;
                    remain = true;
                }
            }
            else
            {
                GM.DisplayText3("Fuel += " + count + "mL", false, 0);
            }
            break;
        }

        if (!remain)
        {
            Destroy(gameObject);
        }
    }
Exemplo n.º 24
0
    public void EnterCommand(string com)
    {
        string[] coms = com.Split('/');

        /*
         * for (int i = 0; i < coms.Length; i++)
         * {
         *  coms[i] = coms[i].ToLower();
         *  Debug.Log(coms[i]);
         * }
         */

        try
        {
            switch (coms[0])
            {
            case "player":
                switch (coms[1])
                {
                case "health":
                    if (coms[2] == "max")
                    {
                        GM.GetGM().player.GetComponent <PlayerStats>().health = GM.GetGM().player.GetComponent <PlayerStats>().maxHealth;
                    }
                    else
                    {
                        GM.GetGM().player.GetComponent <PlayerStats>().health = GM.GetFloat(coms[2], GM.GetGM().player.GetComponent <PlayerStats>().health);
                    }
                    GM.DisplayText("Command entered.", true);
                    break;

                case "maxhealth":
                    GM.GetGM().player.GetComponent <PlayerStats>().maxHealth = GM.GetFloat(coms[2], GM.GetGM().player.GetComponent <PlayerStats>().maxHealth);
                    GM.DisplayText("Command entered.", true);
                    break;

                case "fuel":
                    GM.GetGM().player.GetComponent <PlayerMove>().fuel = GM.GetFloat(coms[2], GM.GetGM().player.GetComponent <PlayerMove>().fuel);
                    GM.DisplayText("Command entered.", true);
                    break;

                case "maxfuel":
                    GM.GetGM().player.GetComponent <PlayerMove>().maxFuel = GM.GetFloat(coms[2], GM.GetGM().player.GetComponent <PlayerMove>().maxFuel);
                    GM.DisplayText("Command entered.", true);
                    break;

                case "god":
                    if (coms[2] == "enable")
                    {
                        GM.GetPlayer().GetComponent <PlayerStats>().god = true;
                    }
                    if (coms[2] == "disable")
                    {
                        GM.GetPlayer().GetComponent <PlayerStats>().god = false;
                    }
                    else
                    {
                        GM.DisplayText("Invalid command", true);
                    }
                    break;

                default:
                    GM.DisplayText("Unknown command", true);
                    break;
                }
                break;

            case "getitem":
                switch (coms[1])
                {
                case "module":
                    foreach (Module _GM_M in GM.GetGM().modulesList)
                    {
                        if (_GM_M.ID == coms[2] && _GM_M.level == GM.GetFloat(coms[3], 1))
                        {
                            PlayerModuleManager mm = GM.GetPlayer().GetComponent <PlayerModuleManager>();
                            if (mm.InsertModule(_GM_M) == false)
                            {
                                GM.DisplayText("Unable to add module", true);
                            }
                        }
                    }
                    break;

                case "weapon":
                    foreach (Item _GM_I in GM.GetGM().itemsList)
                    {
                        if (_GM_I.name == coms[2])
                        {
                            GameObject wp = Instantiate((_GM_I.obj), transform.position, Quaternion.identity);
                            wp.GetComponent <WeaponStats>()._GM_ = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
                            wp.GetComponent <WeaponStats>().PickUp(GM.GetPlayer().GetComponent <PlayerPickUp>().weaponsFolder.transform);
                            GM.DisplayText("Picked up: " + _GM_I.name, false);
                            GM.DisplayText("Command entered.", true);
                        }
                    }
                    break;

                case "deployable":
                    foreach (Item _GM_I in GM.GetGM().itemsList)
                    {
                        if (_GM_I.name == coms[2])
                        {
                            Item a = _GM_I;
                            a.count = Mathf.RoundToInt(GM.GetFloat(coms[3], GM.GetGM().player.GetComponent <PlayerMove>().maxFuel));
                            DeployablesManager dm = GM.GetPlayer().GetComponent <DeployablesManager>();
                            dm.dplybles_count[dm.deployables.IndexOf(a.obj)] += (int)a.count;
                            GM.DisplayText("Picked up: " + a.name + " GRND x (" + a.count + ")", false);
                            GM.DisplayText("Command entered.", true);
                        }
                    }
                    break;

                case "ammo":
                    PlayerWeaponManager wm = GM.GetPlayer().GetComponent <PlayerWeaponManager>();
                    wm.ammo_count[wm.ammo_type.IndexOf(coms[2])] += Mathf.RoundToInt(GM.GetFloat(coms[3], 0));
                    GM.DisplayText("Picked up: " + coms[2] + " x (" + GM.GetFloat(coms[3], 0) + ")", false);
                    break;

                default:
                    GM.DisplayText("Unknown command", true);
                    break;
                }
                break;

            case "clock":
                if (coms[1] == "pause")
                {
                    GM.GetGM().gameObject.GetComponent <Clock>().paused = true;
                }
                else if (coms[1] == "resume")
                {
                    GM.GetGM().gameObject.GetComponent <Clock>().paused = false;
                }
                else if (coms[1] == "time")
                {
                    GM.GetGM().gameObject.GetComponent <Clock>().remainingTime = GM.GetFloat(coms[2], GM.GetGM().gameObject.GetComponent <Clock>().remainingTime);
                }
                else
                {
                    GM.DisplayText("Unknown command", true);
                }
                break;

            case "scores":
                if (coms[1] == "show")
                {
                    GM.GetUI().GetComponent <UI_Scores>().Show();
                }
                if (coms[1] == "hide")
                {
                    GM.GetUI().GetComponent <UI_Scores>().Hide();
                }
                if (coms[1] == "save")
                {
                    GM.GetGM().data.SaveData();
                }
                if (coms[1] == "clear")
                {
                    GM.GetGM().data.ResetData();
                }
                if (coms[1] == "pw")
                {
                    GM.DisplayText("QWERTY", true);
                }
                else
                {
                    GM.DisplayText("Unknown command", true);
                }
                break;

            default:
                GM.DisplayText("Unknown command", true);
                break;
            }
        }
        catch
        {
            GM.DisplayText("Invalid command.", true);
        }
    }
Exemplo n.º 25
0
    public void PickUp(int index)
    {
        //Debug.Log("Picking Up: " + index);
        if (index >= items.Count)
        {
            return;
        }
        Item item   = items[index];
        bool remain = false;

        switch (item.type)
        {
        case "Ammo":
            PlayerWeaponManager wm = player.GetComponent <PlayerWeaponManager>();
            wm.ammo_count[wm.ammo_type.IndexOf(item.name)] += Mathf.RoundToInt(item.count);
            items.Remove(item);
            GM.DisplayText3("Picked up: " + item.name + " x (" + item.count + ")", false, 0);
            break;

        case "Health":
            PlayerStats ps = player.GetComponent <PlayerStats>();
            ps.health += item.count;
            items.Remove(item);
            GM.DisplayText3("Health += " + item.count, false, 0);
            break;

        case "Fuel":
            PlayerMove pm       = player.GetComponent <PlayerMove>();
            float      leftover = pm.AddFuel(item.count);
            if (leftover != 0)
            {
                if (leftover == item.count)
                {
                    GM.DisplayText3("Maximum fuel capacity reached", false, 0);
                }
                else
                {
                    item.count = leftover;
                    remain     = true;
                    GM.DisplayText3("Fuel += " + (item.count - leftover) + "mL", false, 0);
                }
            }
            else
            {
                GM.DisplayText3("Fuel += " + item.count + "mL", false, 0);
            }
            items.Remove(item);
            break;

        case "Module":
            PlayerModuleManager mm = player.GetComponent <PlayerModuleManager>();
            if (mm.InsertModule(item.module) == false)
            {
                remain = true;
            }
            //GM.DisplayText3("Module Added: " + item.module.ID + " [LV. " + item.module.level + "]", false, 0);
            //GM.DisplayText("Module Added: " + item.module.ID + " [LV. " + item.module.level + "]", false);
            items.Remove(item);
            break;

        case "Weapon":
            GameObject wp = Instantiate((item.obj), transform.position, Quaternion.identity);
            wp.GetComponent <WeaponStats>()._GM_ = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
            wp.GetComponent <WeaponStats>().PickUp(player.GetComponent <PlayerPickUp>().weaponsFolder.transform);
            GM.DisplayText("Picked up: " + item.name, false);
            GM.DisplayText3("Picked up: " + item.name, false, 0);
            items.Remove(item);
            break;

        case "Deployable":
            DeployablesManager dm = player.GetComponent <DeployablesManager>();
            dm.dplybles_count[dm.deployables.IndexOf(item.obj)] += (int)item.count;
            GM.DisplayText3("Picked up: " + item.name + " GRND x (" + item.count + ")", false, 0);
            GM.DisplayText("Picked up: " + item.name + " GRND x (" + item.count + ")", false);
            items.Remove(item);
            break;
        }
        if (remain)
        {
            items.Add(item);
        }
        RefreshSlots();
    }
Exemplo n.º 26
0
 private void Awake()
 {
     Instance = this;
 }
Exemplo n.º 27
0
 // Start is called before the first frame update
 void Start()
 {
     _GM_   = GameObject.FindGameObjectWithTag("GM").GetComponent <GM>();
     player = _GM_.player;
     WM     = player.GetComponent <PlayerWeaponManager>();
 }