Beispiel #1
0
 /// <summary>
 /// Sets all necessary references.
 /// </summary>
 /// <param name="shooter"></param>
 public void Setup(ShooterManager shooter)
 {
     //networkLayer = this.GetComponent<BulletNetworkLayer>();
     this.shooter  = shooter;
     playerManager = shooter.GetComponent <PlayerManager>();
     //this.collider.enabled = shooter.GetComponent<PhotonView>().isMine;
 }
 /// <summary>
 /// Sets all necessary references.
 /// </summary>
 /// <param name="shooter"></param>
 public void Setup(ShooterManager shooter)
 {
     //networkLayer = this.GetComponent<BulletNetworkLayer>();
     this.shooter = shooter;
     playerManager = shooter.GetComponent<PlayerManager>();
     //this.collider.enabled = shooter.GetComponent<PhotonView>().isMine;
 }
 // Update is called once per frame
 void Update()
 {
     if ((SceneManager.GetActiveScene().name == ID.SceneNames[(int)ID.Scenes.ARAdd]) && !_GetLoginSceneGameObjects)
     {
         _Shooter                  = GameObject.FindWithTag("MainCamera");
         _ShooterManager           = _Shooter.GetComponent <ShooterManager>();
         _NewARAdd                 = GameObject.FindWithTag("_NewARAdd");
         _ARAddManager             = _NewARAdd.GetComponent <ARAddManager>();
         _GetLoginSceneGameObjects = true;
         Debug.Log(_ARAddManager.ARAddType);
     }
 }
Beispiel #4
0
    /// <summary>
    /// Initializes all necessary references.
    /// </summary>
    /// <param name="playerControlled">Boolean containing if the player is local and is not a bot.</param>
    public void StartMovementManager(bool playerControlled)
    {
        playerManager  = this.GetComponent <PlayerManager>();
        shooterManager = this.GetComponent <ShooterManager>();

        if (playerControlled)
        {
            InputManager.instance.AddListener(OnTouchBegan, OnTouchMove, OnTouchEnd);
        }

        leftTouchfingerID  = -1;
        rightTouchfingerID = -1;
    }
    /// <summary>
    /// Initializes all necessary references.
    /// </summary>
    /// <param name="playerControlled">Boolean containing if the player is local and is not a bot.</param>
    public void StartMovementManager(bool playerControlled)
    {
        playerManager = this.GetComponent<PlayerManager>();
        shooterManager = this.GetComponent<ShooterManager>();

        if (playerControlled)
        {
            InputManager.instance.AddListener(OnTouchBegan, OnTouchMove, OnTouchEnd);
        }

        leftTouchfingerID = -1;
        rightTouchfingerID = -1;
    }
Beispiel #6
0
    /// <summary>
    /// Start method. Gets all references.
    /// </summary>
    public void StartPlayer(bool playerControlled, TeamTypes myTeam, string playerPlayFabID, string playFabName)
    {
        this.playerPlayFabID   = playerPlayFabID;
        this.myTeam            = myTeam;
        this.playerControlled  = playerControlled;
        this.playerPlayFabName = playFabName;

        myProperties     = this.GetComponent <PlayerProperties>();
        networkLayer     = this.GetComponent <PlayerNetworkLayer>();
        animationManager = this.GetComponent <PlayerAnimationManager>();
        shooterManager   = this.GetComponent <ShooterManager>();
        aiManager        = this.GetComponent <PlayerAIManager>();

        shooterManager.CreateBuffer(myTeam);

        myTower = GameController.instance.GetTower(myTeam);

        playerExp = playerLevel = 0;

        myProperties.Initialize();

        baseSprite.color = spriteTeamColors[myTeam.GetHashCode()];

        Debug.Log("initializing player. is human? " + playerControlled + " is local? " + networkLayer.isMine);
        if (networkLayer.isMine)
        {
            if (playerControlled)
            {
                Camera.main.transform.SetParent(this.transform, true);

                //levelText = GameController.instance.GetLevelText();
                expText = GameController.instance.GetExpText();

                GameplayUI.instance.Initialize(myTeam, this);
                GameplayUI.instance.UpdateSidebarStats(myProperties);

                InGameStoreAndCurrencyManager.instance.SetUpgradesCallbacks(new ProjectDelegates.OnPlayerBoughtStatUpgradeCallback[] {
                    myProperties.IncreaseAtk, myProperties.IncreaseMovSpd, myProperties.IncreaseHP
                });
            }

            this.transform.position = GameController.instance.GetRandomSpawnPoint(myTeam);
        }
    }
    /// <summary>
    /// Start method. Gets all references.
    /// </summary>
    public void StartPlayer(bool playerControlled, TeamTypes myTeam, string playerPlayFabID, string playFabName)
    {
        this.playerPlayFabID = playerPlayFabID;
        this.myTeam = myTeam;
        this.playerControlled = playerControlled;
        this.playerPlayFabName = playFabName;

        myProperties = this.GetComponent<PlayerProperties>();
        networkLayer = this.GetComponent<PlayerNetworkLayer>();
        animationManager = this.GetComponent<PlayerAnimationManager>();
        shooterManager = this.GetComponent<ShooterManager>();
        aiManager = this.GetComponent<PlayerAIManager>();

        shooterManager.CreateBuffer(myTeam);

        myTower = GameController.instance.GetTower(myTeam);

        playerExp = playerLevel = 0;

        myProperties.Initialize();

        baseSprite.color = spriteTeamColors[myTeam.GetHashCode()];

        Debug.Log("initializing player. is human? " + playerControlled+" is local? "+networkLayer.isMine);
        if (networkLayer.isMine)
        {
            if (playerControlled)
            {
                Camera.main.transform.SetParent(this.transform, true);

                //levelText = GameController.instance.GetLevelText();
                expText = GameController.instance.GetExpText();

                GameplayUI.instance.Initialize(myTeam,this);
                GameplayUI.instance.UpdateSidebarStats(myProperties);

                InGameStoreAndCurrencyManager.instance.SetUpgradesCallbacks(new ProjectDelegates.OnPlayerBoughtStatUpgradeCallback[]{
                    myProperties.IncreaseAtk,myProperties.IncreaseMovSpd,myProperties.IncreaseHP
                });
            }

            this.transform.position = GameController.instance.GetRandomSpawnPoint(myTeam);
        }
    }