private void OnTriggerEnter(Collider other) { CharacterControls charControl = other.gameObject.GetComponent <CharacterControls>(); if (charControl == null) { return; } charControl.rb.velocity = Vector3.zero; if (!charControl.isMainPlayeer) { charControl.gameObject.SetActive(false); } else { charControl.gameObject.transform.position = charPos.transform.position; charControl.gameObject.transform.rotation = Quaternion.identity; charControl.anim.SetBool("isRunning", false); charControl.enabled = false; sprayObject.SetActive(true); } charControl.finishedRank = UICurrentRank.GetMyRank(charControl); if (charControl.isMainPlayeer) { mainCamera.gameObject.SetActive(false); UIRank.SetActive(false); paintPercent.SetActive(true); PaintObject.gameObject.SetActive(true); } }
// Start is called before the first frame update void Start() { instance = this; characterList = GameObject.FindObjectsOfType <CharacterControls>().ToList(); for (int i = 0; i < txtRank.Length; i++) { if (i < 3) { txtRank[i].color = Color.green; } if (i >= 3) { txtRank[i].color = Color.red; } } }