void OnTriggerEnter(Collider other) { if (other.tag == "Enemy") { health = other.GetComponent <Health>(); ControllerThing CT = controller.GetComponent <ControllerThing>(); health.modifyHealth(10, 3); Destroy(gameObject); } }
// Use this for initialization void Start() { DontDestroyOnLoad(transform.gameObject); controllerThing = GameObject.Find("Controller Thing"); controller = controllerThing.GetComponent <ControllerThing>(); abilities = controllerThing.GetComponent <PlayerAbilityController>(); cooldowns = controllerThing.GetComponent <PlayerCDController>(); health = GetComponent <Health>(); anim = GetComponent <Animator>(); h2 = health.health; }
// Update is called once per frame void Update() { for (int i = 1; i < 5; i++) { if (Input.GetKeyDown("joystick " + i + " button 7")) { print("joystick " + i + " button 7"); ControllerThing CT = controllerThing.GetComponent <ControllerThing>(); CT.AssignIDsToArray(i); } } }
// Use this for initialization void Start() { ID = GetComponent <PlayerID>(); playerbody = GetComponent <Rigidbody>(); controller = GameObject.FindGameObjectWithTag("Controller").GetComponent <ControllerThing>(); player = this.gameObject; isDead = false; jumpDir = Vector3.up * -1; ray = new Ray(transform.position, Vector3.up); }
// Use this for initialization void Start() { if (controllerThing == null) { controllerThing = GameObject.Find("Controller Thing"); } controller = controllerThing.GetComponent <ControllerThing>(); // At start the boss finds targets in the arena. // damageThreat is the threat from damage // distanceThreat is the threat from distance // combinedThreat is the combined output of the 2 damageThreat = new float[controller.targets.Length]; distanceThreat = new float[controller.targets.Length]; combinedThreat = new float[controller.targets.Length]; }
// Use this for initialization void Start() { DontDestroyOnLoad(transform.gameObject); healVisual = GameObject.CreatePrimitive(PrimitiveType.Cylinder); healVisual.SetActive(false); DontDestroyOnLoad(healVisual); healVisual.GetComponent <Renderer>().material.color = Color.green; controllerThing = GameObject.Find("Controller Thing"); controller = controllerThing.GetComponent <ControllerThing>(); abilities = controllerThing.GetComponent <PlayerAbilityController>(); cooldowns = controllerThing.GetComponent <PlayerCDController>(); health = GetComponent <Health>(); anim = GetComponent <Animator>(); h2 = health.health; }
// Use this for initialization void Start() { controllerThing = GameObject.Find("Controller Thing"); controller = controllerThing.GetComponent <ControllerThing>(); players = new GameObject[4]; playerHealth = new Health[4]; texts = GetComponentsInChildren <Text>(); images = GetComponentsInChildren <Image>(); timer = 600; bossHealth = boss.GetComponent <Health>(); playerCooldowns = controller.GetComponent <PlayerCDController>(); healths1 = new float[4]; healths2 = new float[4]; // Assigns players to slots based on IDs, for use with UI placement. //IE: Tank is in the top left, always. //This might be changed to player positions. So P1 is in the top left, P2 top right, etc for (int i = 0; i < controller.IDs.Length; i++) { players[i] = controller.IDs[i].gameObject; playerHealth[i] = players[i].GetComponent <Health>(); healths2[i] = playerHealth[i].health; } foreach (Image element in images) { if (element.tag == "AbilityIcon") { icons.Add(element); } if (element.tag == "HealthBar") { healthBars.Add(element); } if (element.tag == "PlayerPortrait") { portraits.Add(element); } } }
// Use this for initialization void Start() { playerbody = GetComponent <Rigidbody>(); controller = GameObject.FindGameObjectWithTag("Controller").GetComponent <ControllerThing>(); player = this.gameObject; }
// Use this for initialization void Start() { cooldown = GetComponent <PlayerCDController>(); controller = GetComponent <ControllerThing>(); }