コード例 #1
0
    // Use this for initialization
    void Start()
    {
        inputManager           = GameManager.getInstance().getInputManager();
        weaponManager          = GameManager.getInstance().getWeaponManager();
        weaponSelectionManager = GameManager.getInstance().getWSelectionManager();

        //Creates a pool for weapons
        weaponManager.CreatePool(weaponSelectionManager.getMainWeapon(), 100);
        weaponManager.CreatePool(weaponSelectionManager.getAltWeapon(), 10);

        // If view is ours, attach us to the input manager
        if (photonView.isMine)
        {
            // Subscribe to all shooting input events
            inputManager.subscribeToInputGroup(EInputGroup.ShootingInput, this);
        }
    }
コード例 #2
0
    // Use this for initialization
    void Awake()
    {
        // Set the singleton instance
        GameManager.instance = this;

        // Load other managers
        // PS: We don't make them as a game components, because we want them to be only accessible through the GameManager instance


        // Load and initialize InputManager
        this.inputManager = new InputManager(this);

        //Load and initialize WeaponManager
        this.weaponManager = new WeaponManager(this);

        this.weaponSelectionManager = new WSelectionManager(this);
    }