private void Start() { m_inputHandler = GetComponent <Player_Input_Handler>(); m_playerStats = GetComponent <Player_Stats>(); m_ammoCount = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/UI/Canvas/InGame/AmmoCounter").GetComponent <Text>(); m_gunName = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/UI/Canvas/InGame/GunName").GetComponent <Text>(); m_reloadingText = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/UI/Canvas/InGame/ReloadingText").gameObject; m_crosshair = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/UI/Canvas/InGame/Crosshair").gameObject; m_camera = GetComponentInChildren <Camera>(); m_centreOfScreen = new Vector3(0.5f, 0.5f, 0); UI = GetComponent <InventoryUI>(); bloodSplatterObject = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/BloodSplatter").gameObject; bloodSplatterEffect = bloodSplatterObject.GetComponent <ParticleSystem>(); equipped = 0; m_canAim = true; m_canFire = true; }
// Use this for initialization void Start() { // Get components body = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); Srenderer = GetComponent <SpriteRenderer>(); // Set base params stats = new Player_Stats(); atkCharge = 0.5f; ammo = 100f; ammo_regen = new Regen_Counter(0.3f, 0.2f); shieldRegenTime = shieldMaxRegenTime; shieldRecoverTime = shieldMaxRecoverTime; // Create weapon object and make it follow you wep = (Weapon)Instantiate(weapon, body.position, transform.rotation); wep.stats = stats; wep.transform.parent = transform; score = new ScoreBoard(); spawnerCheck = 0; spawnerTime = 10; }
private void Awake() { HealthSlider.maxValue = Health; HealthSlider.value = Health; InitialHealth = Health; instancia = this; }
// Use this for initialization void Start() { trans = GetComponent <Transform>(); rb = GetComponent <Rigidbody>(); anim = GetComponent <Animator>(); playerStats = GetComponent <Player_Stats>(); input = GetComponent <GameInputs>(); nearEnemies = GetComponent <HandleNearEnemies>(); capsule = GetComponent <CapsuleCollider>(); capsuleHeight = capsule.height; capsuleCenter = capsule.center; rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; origGroundCheckDistance = groundCheckDistance; cam = Camera.main.transform; isGrounded = true; cursor = CursorLockMode.Locked; GameObject obj = GameObject.FindGameObjectWithTag("PlayerMelee"); meleeCollider = obj.GetComponent <BoxCollider>(); meleeCollScript = obj.GetComponent <MeleeCollider>(); isRunning = false; }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); pstats = GameObject.FindGameObjectWithTag("GameManager").GetComponent <Player_Stats>(); anim.runtimeAnimatorController = Resources.Load(pstats.playerChoice) as RuntimeAnimatorController;////CHANGES THE ANIMATOR OF THIS GAME OBJECT }
void Awake() { pS = GetComponent <Player_Stats>(); pI = GetComponent <Player_Inventory>(); pE = GetComponent <Player_Equipped>(); pM = GetComponent <Player_Movement>(); //movC = GetComponent<Collider2D>(); }
// Use this for initialization void Start() { stats = this.GetComponent <Player_Stats>(); localTransform = this.transform; localRigidbody = this.GetComponent <Rigidbody> (); localCharacter = this.GetComponent <CharacterController> (); ToggleFast(false); }
// Use this for initialization void Start() { party = FindObjectOfType <Player_party>(); player = FindObjectOfType <Player_Stats>(); scene = FindObjectOfType <SceneSwitch>(); pets[0] = party.party_clones[1].GetComponent <Pets_stats>(); pets[1] = party.party_clones[2].GetComponent <Pets_stats>(); pets[2] = party.party_clones[3].GetComponent <Pets_stats>(); }
// Use this for initialization void Start() { ps = GameObject.Find("Player").GetComponent <Player_Stats>(); sr = GetComponent <SpriteRenderer>(); Light = (Random.Range(0, 2) == 1); ChooseSprite(); var sw = TrySwitchLight(); StartCoroutine(sw); }
private void InstantiatePlayerSettings() { if (Instance == null) { Instance = this; DontDestroyOnLoad(this); } else if (this != Instance) { Destroy(this.gameObject); } }
void Awake() { if (stats == null) { //DontDestroyOnLoad(gameObject); stats = this; } else if (stats != this) { Destroy(gameObject); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("player_change_state_collider")) { player_stats = collision.transform.parent.GetComponent <Player_Stats>(); if (player_stats != null) { player_stats.Add_Material(1, type); is_used = true; } } }
/*UIparty 0-4 Name, healthMax, healthCurrent, magicCurrent, magicMax */ // Use this for initialization void Start() { gameManager = GameObject.FindGameObjectWithTag("GameManager"); for (int i = 0; i < 28; i++) { ui[i] = UIparty[i].GetComponent <Text>(); } player = gameManager.GetComponent <Player_Stats>(); party = gameManager.GetComponent <Player_party>(); elist = GetComponent <Enemy_List>(); StartCoroutine(TimeDelay(0.5f)); }
// Use this for initialization void Start() { gameManager = GameObject.FindGameObjectWithTag("GameManager"); ui = combat.GetComponent <Combat>(); player = gameManager.GetComponent <Player_Stats>(); abilName[0] = ability1UI.GetComponentInChildren <Text>(); abilName[1] = ability2UI.GetComponentInChildren <Text>(); abilName[2] = ability3UI.GetComponentInChildren <Text>(); abilName[3] = ability4UI.GetComponentInChildren <Text>(); clones = gameManager.GetComponent <Player_party>(); }
private void Awake() { Instance = this; player_Animation = GetComponent <Player_Animation>(); player_Stats = GetComponent <Player_Stats>(); player_Collision = GetComponent <Player_Collision>(); player_Actions = GetComponent <Player_Actions>(); player_Input = GetComponent <Player_Input>(); player_Equipment = GetComponent <Player_Equipment>(); player_Quest = GetComponent <Player_Quest>(); player_Event = GetComponent <Player_Events>(); animator = GetComponent <Animator>(); rb2D = GetComponent <Rigidbody2D>(); }
void Awake() { switchListBool = new bool[20]; switchListInt = new int[20]; DontDestroyOnLoad(gameObject); if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } }
private void Start() { if (Motor == null) { Debug.LogError("Error Linking Controller System"); return; } OrbitCamera = GetComponentInChildren <KIN_Cam>(); if (isLocal) { //joystick _Joystick = FindObjectOfType <VariableJoystick>(); if (_Joystick == null) { Debug.LogError("Joystick not found"); return; } // Camera OrbitCamera.IgnoredColliders.Clear(); OrbitCamera.IgnoredColliders.AddRange(gameObject.GetComponents <Collider>()); //seperate the camera OrbitCamera.transform.parent = null; OrbitCamera.SetFollowTransform(CameraFollowPoint); // instances refrence UIManager.Instance.JumpButton.onClick.AddListener(OnJumpPressed); } else { gameObject.name = "AI_Player" + gameObject.GetInstanceID(); GameObject.Destroy(OrbitCamera.gameObject); } //players stats playerstats = GetComponent <Player_Stats>(); _Combiner = GetComponentInChildren <SkinnedMeshCombiner>(); // tran to default: TransitionToState(CharacterState.Default); }
//add player with default values public Player_Stats Add_Player(int _player_id) { for (int i = 0; i < all_player_stats.Count; i++) { if (all_player_stats[i].player_id == _player_id) { return(all_player_stats[i]); } } Player_Stats player_record = new Player_Stats(); player_record.player_id = _player_id; player_record.kills = 0; player_record.deaths = 0; player_record.time_of_death = 0f; all_player_stats.Add(player_record); return(player_record); //is this returning a copy or a reference? }
void Start() { PV = GetComponent <PhotonView>(); playerController = GetComponent <Player_Controller>(); inputHandler = GetComponent <Player_Input_Handler>(); gunManager = GetComponent <GunManager>(); playerStats = GetComponent <Player_Stats>(); networking = GetComponent <Player_Networking>(); uiScript = GetComponent <InventoryUI>(); SpawnAvatar(); UI = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/UI").gameObject; playerBody = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/Body").gameObject; playerCamera = transform.Find("/PhotonPlayer(Clone)/PhotonPlayerAvatar(Clone)/GFX/RotationHelper/CameraObject").gameObject; if (!PV.IsMine) { playerController.enabled = false; inputHandler.enabled = false; //gunManager.enabled = false; playerStats.enabled = false; networking.enabled = false; uiScript.enabled = false; } if (PV.IsMine) { playerCamera.gameObject.SetActive(true); UI.gameObject.SetActive(true); playerBody.SetActive(false); } playerController.SetupForMovement(); gunManager.SetupForShooting(); uiScript.SetupForShooting(); playerStats.Setup(); }
// Use this for initialization void Start() { anim = GetComponent <Animator>(); gameManager = GameObject.FindGameObjectWithTag("GameManager"); scene = gameManager.GetComponent <SceneSwitch>(); pstats = gameManager.GetComponent <Player_Stats>(); anim.runtimeAnimatorController = Resources.Load(pstats.playerChoice) as RuntimeAnimatorController;////CHANGES THE ANIMATOR OF THIS GAME OBJECT if (menu.active == true) { menu.SetActive(false); } combattame.SetActive(true); this.transform.position = gameManager.transform.position; }
private void Awake() { /*string path_to_save_file = "/JSON/playerStats.json"; * string filePath = Application.dataPath + path_to_save_file; * Stats stat = new Stats(); * * * string dataAsJson = File.ReadAllText(filePath); * * stat = JsonUtility.FromJson<Stats>(dataAsJson); * * myStats = stat;*/ //player_stats. //player_stats.Right_Hand_Object = new Object_InGame(); player_stats = GetComponent <Player_Stats>(); improveScr = GetComponent <ImproveManager>(); player_stats.Right_Hand_Object = new Object_InGame(); player_stats.Right_Hand_Object.damage = PlayerPrefs.GetInt("playerDamage"); live_manager_scr.numHearts = PlayerPrefs.GetInt("playerLive"); improveScr.improveBar.fillAmount = PlayerPrefs.GetFloat("playerImprove"); //Debug.Log(dataAsJson); }
void Start() { ph = GameObject.Find("Player").GetComponent <Player_Stats>(); camera = GameObject.Find("Main Camera"); maxOffset = camera.transform.position - transform.position; }
public void Start() { UI = GetComponentInParent <InventoryUI>(); stats = GetComponentInParent <Player_Stats>(); purchaseText.text = price.ToString(); }
public float aheadSpeed; // speed of camera // Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); Stats = gameObject.GetComponent <Player_Stats>(); currentlife = Stats.Player_life; }
private void Awake() { //Gets the Scripts from the Player PC2 = Player.GetComponent <PlayerController2>(); PS = Player.GetComponent <Player_Stats>(); }
// Use this for initialization void Start () { // Get components body = GetComponent<Rigidbody2D>(); anim = GetComponent<Animator>(); Srenderer = GetComponent<SpriteRenderer>(); // Set base params stats = new Player_Stats(); atkCharge = 0.5f; ammo = 100f; ammo_regen = new Regen_Counter(0.3f, 0.2f); shieldRegenTime = shieldMaxRegenTime; shieldRecoverTime = shieldMaxRecoverTime; // Create weapon object and make it follow you wep = (Weapon) Instantiate( weapon, body.position, transform.rotation ); wep.stats = stats; wep.transform.parent = transform; score = new ScoreBoard(); spawnerCheck = 0; spawnerTime = 10; }
public void SetParent(Player_Stats player_Stats) { parent = player_Stats; value = new ModifiableInt(AttributeModified); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player").GetComponent <Player_Stats>(); image = GetComponent <Image>(); }
//Attack is called by animation event!! void Start() { Stats = gameObject.GetComponent <Player_Stats>(); }
// Use this for initialization void Start() { plist = gameManager.GetComponent <Player_party>(); playerstats = gameManager.GetComponent <Player_Stats>(); }
void Start() { player = GetComponentInParent <Player_Stats>(); print("Player Attack Value: " + player.BaseAttack); }