void Start() { MatchController = GameObject.FindWithTag("GameController"); OffenseScript = GetComponent <PlayerOffense>(); PlayerNumber = OffenseScript.PlayerNumber; }
// Use this for initialization void Start() { //get the animator MatchController = GameObject.FindWithTag("GameController"); animator = PlayerModel.GetComponent <Animator>(); PlayerHealthScript = PlayerParent.GetComponent <PlayerHealth>(); PlayerMovementScript = PlayerParent.GetComponent <PlayerMovement>(); PlayerOffenseScript = PlayerParent.GetComponent <PlayerOffense>(); sword = this.transform.Find("Sword").gameObject; }
// Use this for initialization void Start() { Quaternion q = Quaternion.AngleAxis(100 * Time.time, Vector3.up); Vector3 Rotation = transform.forward * 20; movementScript = GetComponent <PlayerMovement>(); Controller = GetComponent <CharacterController>(); PlayerHP = GetComponent <PlayerHealth>(); PlayerAttack = GetComponent <PlayerOffense>(); MatchController = GameObject.FindWithTag("GameController"); EBRateOfFireMulitiCountMax = MultiHit; }
// Use this for initialization void Start() { Quaternion q = Quaternion.AngleAxis(100 * Time.time, Vector3.up); Vector3 Rotation = transform.forward * 20; movementScript = GetComponent <PlayerMovement>(); Controller = GetComponent <CharacterController>(); PlayerHP = GetComponent <PlayerHealth>(); PlayerAttack = GetComponent <PlayerOffense>(); PlayerAnimation = GetComponent <PlayerAnimations>(); MatchController = GameObject.FindWithTag("GameController"); EBRateOfFireMulitiCountMax = MultiHit; SpawnTarget = (GameObject)Instantiate(TeleportTarget, transform.position, movementScript.CameraT.rotation); Target = SpawnTarget; Target.SetActive(false); }
void Start() { MatchController = GameObject.FindWithTag("GameController"); Disable = GameObject.FindWithTag("P3HudRemove"); Disable2 = GameObject.FindWithTag("P4HudRemove"); OffenseScript = GetComponent <PlayerOffense>(); PlayerNumber = OffenseScript.PlayerNumber; switch (PlayerNumber) { default: { break; } case 1: { CurrentHealthBar = GameObject.FindWithTag("P1HP").GetComponent <Image>(); RatioText = GameObject.FindWithTag("P1HPRatio").GetComponent <Text>(); CurrentManaBar = GameObject.FindWithTag("P1MP").GetComponent <Image>(); ManaRatioText = GameObject.FindWithTag("P1MPRatio").GetComponent <Text>(); CurrentArmourBar = GameObject.FindWithTag("P1Armour").GetComponent <Image>(); ArmourRatioText = GameObject.FindWithTag("P1ArmourRatio").GetComponent <Text>(); break; } case 2: { CurrentHealthBar = GameObject.FindWithTag("P2HP").GetComponent <Image>(); RatioText = GameObject.FindWithTag("P2HPRatio").GetComponent <Text>(); CurrentManaBar = GameObject.FindWithTag("P2MP").GetComponent <Image>(); ManaRatioText = GameObject.FindWithTag("P2MPRatio").GetComponent <Text>(); CurrentArmourBar = GameObject.FindWithTag("P2Armour").GetComponent <Image>(); ArmourRatioText = GameObject.FindWithTag("P2ArmourRatio").GetComponent <Text>(); break; } case 3: { if (MatchController.GetComponent <PreGameSetup>().PlayerCount > 1) { CurrentHealthBar = GameObject.FindWithTag("P3HP").GetComponent <Image>(); RatioText = GameObject.FindWithTag("P3HPRatio").GetComponent <Text>(); CurrentManaBar = GameObject.FindWithTag("P3MP").GetComponent <Image>(); ManaRatioText = GameObject.FindWithTag("P3MPRatio").GetComponent <Text>(); CurrentArmourBar = GameObject.FindWithTag("P3Armour").GetComponent <Image>(); ArmourRatioText = GameObject.FindWithTag("P3ArmourRatio").GetComponent <Text>(); } break; } case 4: { if (MatchController.GetComponent <PreGameSetup>().PlayerCount > 2) { CurrentHealthBar = GameObject.FindWithTag("P4HP").GetComponent <Image>(); RatioText = GameObject.FindWithTag("P4HPRatio").GetComponent <Text>(); CurrentManaBar = GameObject.FindWithTag("P4MP").GetComponent <Image>(); ManaRatioText = GameObject.FindWithTag("P4MPRatio").GetComponent <Text>(); CurrentArmourBar = GameObject.FindWithTag("P4Armour").GetComponent <Image>(); ArmourRatioText = GameObject.FindWithTag("P4ArmourRatio").GetComponent <Text>(); } break; } } switch (PlayerNumber) { default: { break; } case 1: { MatchController.GetComponent <PreGameSetup>().Player1 = this.gameObject; break; } case 2: { MatchController.GetComponent <PreGameSetup>().Player2 = this.gameObject; break; } case 3: { MatchController.GetComponent <PreGameSetup>().Player3 = this.gameObject; break; } case 4: { MatchController.GetComponent <PreGameSetup>().Player4 = this.gameObject; break; } } }