Beispiel #1
0
 // Start is called before the first frame update
 void Awake()
 {
     m_PlayerReferences = GetComponent <PlayerReferences>();
     m_PlayerInput      = m_PlayerReferences.playerInput;
     m_PlayerClimb      = m_PlayerReferences.playerClimb;
     m_Rigidbody        = m_PlayerReferences.rigRigidbody;
 }
Beispiel #2
0
 private void LoadCityArena(PlayerReferences playerRef, PlayerType playerType, PlayerPosition player)
 {
     if (player == PlayerPosition.Top)
     {
         playerRef.iconName.sprite = playerType.skins[topSkin].iconName;
         playerRef.backWalls.topWalls.activeMaterial   = playerType.skins[topSkin].activeWallMaterial;
         playerRef.backWalls.topWalls.inactiveMaterial = playerType.skins[topSkin].inactiveWallMaterial;
         playerRef.scoreArena.topPoints.activeMaterial = playerType.skins[topSkin].lampMaterial;
         foreach (MeshRenderer renderer in playerRef.scoreArena.topPoints.points)
         {
             renderer.material = playerType.skins[topSkin].lampMaterial;
         }
     }
     else
     {
         playerRef.iconName.sprite = playerType.skins[bottomSkin].iconName;
         playerRef.backWalls.bottomWalls.activeMaterial   = playerType.skins[bottomSkin].activeWallMaterial;
         playerRef.backWalls.bottomWalls.inactiveMaterial = playerType.skins[bottomSkin].inactiveWallMaterial;
         playerRef.scoreArena.bottomPoints.activeMaterial = playerType.skins[bottomSkin].lampMaterial;
         foreach (MeshRenderer renderer in playerRef.scoreArena.bottomPoints.points)
         {
             renderer.material = playerType.skins[bottomSkin].lampMaterial;
         }
     }
 }
Beispiel #3
0
 // Use this for initialization
 void Start()
 {
     bashKeyCode      = KeyCode.L;
     pReference       = gameObject.GetComponentInParent <PlayerReferences>();
     bashMaxDuration  = 5.0f;
     minimumBashForce = 2000;
     bashForce        = minimumBashForce;
 }
Beispiel #4
0
 public void Init(PlayerReferences playerReferences)
 {
     _upText.text    = playerReferences.PlayerController.Up.ToString();
     _downText.text  = playerReferences.PlayerController.Down.ToString();
     _leftText.text  = playerReferences.PlayerController.Left.ToString();
     _rightText.text = playerReferences.PlayerController.Right.ToString();
     _shiftText.text = playerReferences.PlayerController.Shift.ToString();
 }
    private void Awake()
    {
        PlayerReferences PlayerRefs = gameObject.GetComponentInParent <PlayerReferences>();

        m_PlayerClimb  = PlayerRefs.playerClimb;
        m_PlayerWalk   = PlayerRefs.playerWalk;
        m_RigRigidbody = PlayerRefs.rigRigidbody;
    }
Beispiel #6
0
    public virtual void Init(PlayerReferences playerReferences, GunData gun)
    {
        PlayerReferences = playerReferences;
        _gun             = gun;

        _speed             = gun.BulletSpeed;
        _direction         = playerReferences.PlayerController.direction;
        transform.rotation = Quaternion.Euler(90, 0, 0);
    }
Beispiel #7
0
    public void Init(PlayerReferences playerReferences)
    {
        _playerReferences = playerReferences;

        CurrentGun = playerReferences.PlayerData.GetCurrentGunData();
        Ammo       = (int)CurrentGun.Magazine.CurrentLevel.Value;

        Progress?.Invoke(1);
    }
Beispiel #8
0
    public void Init(PlayerReferences playerReferences, GunData specialGun)
    {
        _playerReferences = playerReferences;

        CurrentGun = specialGun;
        Ammo       = (int)CurrentGun.Magazine.CurrentLevel.Value;

        Progress?.Invoke(1);
    }
Beispiel #9
0
    public void Init(GameDataHolder gameData, PlayerReferences player1, PlayerReferences player2)
    {
        _player1GameView.Init(player1);
        _player2GameView.Init(player2);

        _levelText.text = $"Level: {gameData.GameData.Level}";

        GameController.Instance.MobSpawner.OnMobDeath += UpdateMobsLeftText;
        UpdateMobsLeftText();
    }
Beispiel #10
0
        public override void Init(PlayerReferences refs)
        {
            base.Init(refs);

            _jumpTopDistance = _jumpDistance / 2f;

            _gravity.onGravitySwitched += OnGravityChanged;

            TransformGravity();
        }
 // Use this for initialization
 void Awake()
 {
     player                 = GameObject.FindWithTag("Player");
     pReference             = player.GetComponent <PlayerReferences>();
     locationHandler        = pReference.locationHandler;
     ourPointEffector       = GetComponentInChildren <PointEffector2D>();
     proximityTriggerObject = GameObject.Find("PlanetProximityHandler");
     gravityWellObject      = GameObject.Find("GravityWell");
     // parent = transform.parent.gameObject;
 }
Beispiel #12
0
 private void Awake()
 {
     child                      = transform.GetChild(0).gameObject;
     childParticles             = child.GetComponentsInChildren <ParticleSystem>().ToList();
     energyShieldDuration       = 10.0f;
     shieldVisual               = child;
     pReference                 = GetComponentInParent <PlayerReferences>();
     ourBarrierCollider         = GetComponentInChildren <CircleCollider2D>();
     ourBarrierCollider.enabled = false;
 }
 void Awake()
 {
     ourProCamera2D                     = Camera.main.GetComponent <ProCamera2D>();
     gameStateHandler                   = GameObject.Find("Game State Handler").GetComponent <GameStateHandler>();
     playerReferences                   = GetComponent <PlayerReferences>();
     ourSlightshot                      = playerReferences.slingshot;
     ourSoulHandler                     = playerReferences.playerSoulHandler;
     PlayerSoulHandler.PoweredUp       += this.SetPoweredUp;
     PlayerSoulHandler.PowerUpTimedOut += this.SetNOTPoweredUp;
     ChoosePowerUp.powerupChosen       += this.ResetTimeAndSetLaunchToFalse;
 }
Beispiel #14
0
    void Start()
    {
        maxTrackDropInterval  = 10.0f;
        pReference            = GameObject.Find("Player").GetComponent <PlayerReferences>();
        playerLocationHandler = pReference.locationHandler;
        Switch.SwitchEntered += this.SetSwitch;

        ourLineRenderer      = GetComponent <LineRenderer>();
        trackDropParticlesGO = GameObject.Find("TrackDropParticleSystem");
        trackDropParticles   = trackDropParticlesGO.GetComponentsInChildren <ParticleSystem>().ToList();
    }
Beispiel #15
0
    private void Start()
    {
        _playerRefs       = DataPipe.instance.PlayerReferences;
        _gridManager      = DataPipe.instance.GridManager;
        _platformData     = DataPipe.instance.PlatformData;
        _resourceMan      = DataPipe.instance.ResourceManager;
        _radialBuildingUI = DataPipe.instance.BuildingUI;

        _navSurface = DataPipe.instance.NavMeshSurface;
        _navSurface.BuildNavMesh();
    }
 // Use this for initialization
 void Start()
 {
     player     = GameObject.Find("Player");
     pReference = player.GetComponent <PlayerReferences>();
     //        playerMovement = player.GetComponent<PlayerMovement>();
     ourRigidbody             = GetComponent <Rigidbody2D>();
     transform.position       = originFromPlayer.position;
     throwing                 = false;
     ourMeshRenderer          = GetComponent <MeshRenderer>();
     alreadyhookableLayerName = "CurrentlyHooked";
     hookableLayerName        = "Hookable";
     chainRenderer            = GetComponent <LineRenderer>();
 }
Beispiel #17
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     Debug.Log(collision.gameObject.name);
     if (collision.gameObject.CompareTag("Bullet"))
     {
         return;
     }
     if (collision.gameObject.CompareTag("Player"))
     {
         PlayerReferences.LostHealth(1);
     }
     Destroy(this.gameObject);
 }
Beispiel #18
0
    void Awake()
    {
        ourLineRenderer = gameObject.GetComponent <LineRenderer>();

        ChoosePowerUp.laserChosen += this.BeginFiring;

        ourLineRenderer.enabled = false;
        player                = GameObject.FindWithTag("Player");
        playerReferences      = player.GetComponent <PlayerReferences>();
        Switch.SwitchEntered += this.SetOnSwitchTrue;
        Switch.SwitchExited  += this.SetOnSwitchFalse;
        LaserStartParticles   = start.GetComponentsInChildren <ParticleSystem>().ToList();
        laserEndParticles     = end.GetComponentsInChildren <ParticleSystem>().ToList();
    }
Beispiel #19
0
    private void Start()
    {
        if (thePlayer != null)
        {
            Destroy(this.gameObject);
            return;
        }
        Debug.Log("Start");

        currentHealth = maxHealth;
        Debug.Log("Player Health = " + currentHealth);

        thePlayer = this;
        GameObject.DontDestroyOnLoad(this.gameObject);
    }
Beispiel #20
0
        public PlayerReference RegisterPlayerReference(string name)
        {
            bool tournamentHasNotBegun = GetPlayState() == PlayStateEnum.NotBegun;
            bool nameIsNotRegistered   = !PlayerReferences.Any(playerReference => playerReference.Name == name);
            bool nameIsNotEmpty        = name.Length != 0;

            if (tournamentHasNotBegun && nameIsNotRegistered && nameIsNotEmpty)
            {
                PlayerReferences.Add(PlayerReference.Create(name, this));
                OnPlayerReferencesChanged();

                return(PlayerReferences.Last());
            }

            return(null);
        }
Beispiel #21
0
 private void LoadPlayer(PlayerReferences playerRef, PlayerType playerType, int skinIndex, PlayerPosition position, Arena arena)
 {
     playerRef.player.movementType = playerType.movementType;
     playerRef.player.swingType    = playerType.swingType;
     playerRef.player.auraColor    = playerType.skins[skinIndex].auraColor;
     playerRef.animator.runtimeAnimatorController            = position == PlayerPosition.Top ? playerType.skins[skinIndex].animatorTop : playerType.skins[skinIndex].animatorBottom;
     playerRef.player.auraAnimator.runtimeAnimatorController = playerType.skins[skinIndex].auraController;
     playerRef.icon.sprite                        = playerType.skins[skinIndex].icon;
     playerRef.characterName.text                 = playerType.characterName;
     playerRef.characterName.colorGradient        = GetColorGradient(playerType.skins[skinIndex].scoreColors);
     playerRef.characterIntroName.text            = playerType.characterName;
     playerRef.characterIntroName.colorGradient   = GetColorGradient(playerType.skins[skinIndex].scoreColors);
     playerRef.characterIntroImage.sprite         = playerType.skins[skinIndex].characterIntroSprite;
     playerRef.characterScoreNumber.colorGradient = GetColorGradient(playerType.skins[skinIndex].scoreColors);
     playerRef.player.arenaMultipliers            = arena == Arena.scn_case95 ? playerType.pcMultipliers : playerType.cityMultipliers;
 }
Beispiel #22
0
    public override void Init(PlayerReferences playerReferences, GunData gun)
    {
        base.Init(playerReferences, gun);

        Vector3 rotation = Vector3.zero;

        if (_direction.y > 0)
        {
            rotation = new Vector3(0, 0, 90);
        }
        else if (_direction.y < 0)
        {
            rotation = new Vector3(0, 0, -90);
        }
        else if (_direction.x < 0)
        {
            rotation = new Vector3(0, 0, 180);
        }
        _torpedoRenderer.localRotation = Quaternion.Euler(rotation);
    }
Beispiel #23
0
    public void Init(PlayerReferences playerReferences)
    {
        _playerReferences = playerReferences;
        _movementUI.Init(playerReferences);

        _avatar.sprite = playerReferences.LookController.CurrentProfile.Avatar;
        _avatar.SetNativeSize();

        _nameText.text = playerReferences.PlayerData.Name;
        _playerReferences.PlayerData.OnMoneyAmountChange += UpdateMoneyText;

        _playerReferences.Health.OnCurrentHealthChanged += UpdateHealthBar;

        _gunProgress[0].Init(playerReferences.PlayerShoot);
        _gunProgress[1].Init(playerReferences.SpecialWeapons[0]);
        _gunProgress[2].Init(playerReferences.SpecialWeapons[1]);

        UpdateMoneyText();
        UpdateHealthBar();
    }
Beispiel #24
0
        public PlayerReferenceProperty()
        {
            reference = PlayerReferences.localPlayer;
            nickname  = new FsmString()
            {
                UseVariable = true
            };

            actorNumber = new FsmInt()
            {
                UseVariable = true
            };
            userId = new FsmString()
            {
                UseVariable = true
            };
            roomNumber = new FsmInt()
            {
                UseVariable = true
            };
            gameObject = null;
        }
Beispiel #25
0
        public bool ExcludePlayerReference(string name)
        {
            bool tournamentHasNotBegun = GetPlayState() == PlayStateEnum.NotBegun;
            bool nameIsNotEmpty        = name.Length != 0;

            if (tournamentHasNotBegun && nameIsNotEmpty)
            {
                PlayerReference playerReference             = PlayerReferences.FirstOrDefault(playerReference => playerReference.Name == name);
                bool            playerReferenceExistInRound = playerReference != null;

                if (playerReferenceExistInRound)
                {
                    playerReference.MarkForDeletion();
                    PlayerReferences.Remove(playerReference);

                    OnPlayerReferencesChanged();
                    return(true);
                }
            }

            return(false);
        }
Beispiel #26
0
 private void LoadGreekArena(PlayerReferences playerRef, PlayerType playerType, PlayerPosition player)
 {
     if (player == PlayerPosition.Top)
     {
         playerRef.scoreGreekArena.topPoints.activeMaterial   = playerType.skins[topSkin].netMaterialOn;
         playerRef.scoreGreekArena.topPoints.inactiveMaterial = playerType.skins[topSkin].netMaterialOff;
         foreach (MeshRenderer renderer in playerRef.scoreGreekArena.topPoints.points)
         {
             renderer.material = playerType.skins[topSkin].netMaterialOn;
         }
         playerRef.scoreGreekArena.topColor = playerType.skins[topSkin].auraColor;
     }
     else
     {
         playerRef.scoreGreekArena.bottomPoints.activeMaterial   = playerType.skins[bottomSkin].netMaterialOn;
         playerRef.scoreGreekArena.bottomPoints.inactiveMaterial = playerType.skins[bottomSkin].netMaterialOff;
         foreach (MeshRenderer renderer in playerRef.scoreGreekArena.bottomPoints.points)
         {
             renderer.material = playerType.skins[bottomSkin].netMaterialOn;
         }
         playerRef.scoreGreekArena.bottomColor = playerType.skins[bottomSkin].auraColor;
     }
 }
Beispiel #27
0
    private void LoadPcArena(PlayerReferences playerRef, PlayerType playerType, int skinIndex, PlayerPosition position)
    {
        if (playerRef.wallController != null)
        {
            playerRef.wallController.runtimeAnimatorController = playerType.skins[skinIndex].wallController;
        }
        if (playerRef.iconBackgroundPcArena != null)
        {
            playerRef.iconBackgroundPcArena.sprite = playerType.skins[skinIndex].iconBackgroundPcArena;
        }
        foreach (SpriteRenderer point in playerRef.netPoints)
        {
            point.sprite = playerType.skins[skinIndex].wallScoreSprite;
        }

        if (position == PlayerPosition.Top)
        {
            playerRef.scorePcArena.topPointsExplosion = playerType.skins[skinIndex].pointExplosionVfx;
        }
        else
        {
            playerRef.scorePcArena.bottomPointsExplosion = playerType.skins[skinIndex].pointExplosionVfx;
        }
    }
Beispiel #28
0
 public PlayerReference GetPlayerReferenceByName(string name)
 {
     return(PlayerReferences.FirstOrDefault(playerReference => playerReference.Name == name));
 }
Beispiel #29
0
 public void Init(PlayerReferences playerReferences)
 {
     MaxHealth     = playerReferences.PlayerData.Health;
     CurrentHealth = playerReferences.PlayerData.Health;
     Alive         = true;
 }
 // Use this for initialization
 void Start()
 {
     pReference = GetComponentInParent <PlayerReferences>();
 }