//When starting, reset all artifacts and artifact effects private void Start() { ClearPlayerArtifacts(); myPlayerCanvasAnimationmanager = this.GetComponentInChildren <PlayerCanvasAnimationManager>(); myPlayerAnimationmanager = this.GetComponent <PlayerAnimationManager>(); mySprite = this.GetComponent <SpriteRenderer>(); }
// Use this for initialization void Start() { initial_position = this.transform.position; rb = this.GetComponent <Rigidbody> (); animator = this.GetComponentInChildren <Animator> (); psm = this.GetComponent <PlayerScoreManager> (); pam = this.GetComponentInChildren <PlayerAnimationManager>(); pm = this.GetComponent <PlayerManager> (); switch (initial_facing_direction) { case (CharacterFacingDirections.FACING_LEFT): this.transform.localScale = new Vector3(-Mathf.Abs(this.transform.localScale.x), this.transform.localScale.y, this.transform.localScale.z); animator.SetBool(PlayerAnimatorParameters.is_facing_left, true); break; case (CharacterFacingDirections.FACING_RIGHT): this.transform.localScale = new Vector3(Mathf.Abs(this.transform.localScale.x), this.transform.localScale.y, this.transform.localScale.z); animator.SetBool(PlayerAnimatorParameters.is_facing_right, true); break; default: break; } }
//In the beginning we will set up player with full health & update UI void Start() { myWinLoseManager = WinLoseManager.winLoseManager; myPlayerCanvasAnimationmanager = this.GetComponentInChildren<PlayerCanvasAnimationManager>(); myPlayerAnimationmanager = this.GetComponent<PlayerAnimationManager>(); mySprite = this.GetComponent<SpriteRenderer>(); currentLife = maxLife; UpdateUI(); }
private void Awake() { _playerFlip = GetComponent <PlayerFlip>(); _collider2D = GetComponent <BoxCollider2D>(); _rigidbody2D = GetComponent <Rigidbody2D>(); _playerAnimationManager = GetComponent <PlayerAnimationManager>(); // _timeElapsedSinceLastJump = 0f; _castingSkillCoroutine = null; castingSkill = false; }
public void add_player_one(GameObject new_player) { if (!player_1) { player_1 = new_player; } pm = player_1.GetComponent <PlayerManager> (); pm.player_number = 1; pam = player_1.GetComponentInChildren <PlayerAnimationManager> (); pmm = player_1.GetComponent <PlayerMovementManager> (); }
// OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (DoesAnimatorHaveParameter("PlayerCanvasState", animator)) { animator.SetInteger("PlayerCanvasState", PlayerCanvasAnimationManager.GetAnimationIndex(endAnimation)); } else if (DoesAnimatorHaveParameter("State", animator)) { animator.SetInteger("State", PlayerAnimationManager.GetAnimationIndex(endAnimation2)); } }
public void add_player_two(GameObject new_player) { if (!player_2) { player_2 = new_player; } p2m = player_2.GetComponent <PlayerManager> (); p2m.player_number = 2; p2am = player_2.GetComponentInChildren <PlayerAnimationManager> (); p2mm = player_2.GetComponent <PlayerMovementManager> (); }
void Start() { //rigid body rb = GetComponent <Rigidbody2D>(); //animation manager aniMan = GetComponent <PlayerAnimationManager>(); //object's scale at the start startScale = transform.localScale; lastPosX = transform.position.x; }
private void Awake() { PlayerAnimationManager = GetComponentInChildren <PlayerAnimationManager>(); PlayerAnimationManager.SetManager(this); PlayerAttributes = GetComponent <PlayerAttributes>(); PlayerAttributes.SetManager(this); PlayerMovement = GetComponent <PlayerMovement>(); PlayerMovement.SetManager(this); PlayerAudioManager = GetComponentInChildren <PlayerAudioManager>(); PlayerAudioManager.SetManager(this); }
private void Awake() { if (Instance == null) { Instance = this; //DontDestroyOnLoad(gameObject); } else { //Destroy(gameObject); } // //player = ; }
// Use this for initialization void Start() { agent = GetComponent <NavMeshAgent>(); cam = Camera.main; follow = false; animationManager = transform.Find("model").GetComponent <PlayerAnimationManager>(); meshes = gameObject.GetComponentsInChildren <SkinnedMeshRenderer>(); for (int i = 0; i < meshes.Length; i++) { if (meshes[i].name != "Paladin_J_Nordstrom") { meshes[i].enabled = false; } } enemies = GameObject.FindGameObjectsWithTag("enemy"); }
/// <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); } }
// Use this for initialization void Start() { pmm = this.GetComponent <PlayerMovementManager> (); pam = this.GetComponentInChildren <PlayerAnimationManager> (); p_score_m = this.GetComponent <PlayerScoreManager> (); p_sound_m = this.GetComponentInChildren <PlayerSoundManager> (); grav_collider = this.GetComponent <BoxCollider> (); PlayerHandCollider[] hand_colliders = this.GetComponentsInChildren <PlayerHandCollider> (); for (int i = 0; i < hand_colliders.Length; i++) { if (hand_colliders [i].player_hand_placement == PlayerHandCollider.PlayerHandPlacement.FRONT) { front_hand = hand_colliders [i]; } if (hand_colliders [i].player_hand_placement == PlayerHandCollider.PlayerHandPlacement.BACK) { back_hand = hand_colliders [i]; } } animator = this.GetComponentInChildren <Animator> (); Debug.Log(animator); }
// Use this for initialization void Start() { animator = this.transform.parent.parent.GetComponent <Animator> (); pam = animator.GetComponent <PlayerAnimationManager> (); }
public void Start() { _maestro = (Maestro)FindObjectOfType(typeof(Maestro)); _movement = gameObject.GetComponent <SidescrollingMovement>(); _animation = GetComponent <PlayerAnimationManager>(); }
/// <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); } }
private void Start() { aniMan = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerAnimationManager>(); Health = 1f; IsAlive = true; }
// Use this for initialization void Start() { // GET componenets from parents pc = transform.parent.GetComponentInParent <PlayerController>(); pAnim = transform.GetComponentInParent <PlayerAnimationManager>(); }