// Use this for initialization void Start() { sound = GetComponent<AudioSource>(); cam = Camera.main.GetComponent<OverheadCameraController>(); rend = GetComponent<Renderer>(); anim = GetComponent <Animator>(); equipmentCollider = equipment.GetComponent<CapsuleCollider>(); input = GetComponent<TennisInputHandler>(); input.control = this; rb = GetComponent<Rigidbody>(); rend.material.color = c1; alive = true; anim.SetBool("Alive", true); impactMod = 7.5f; respawnPoints = GameObject.FindGameObjectsWithTag("RespawnPoint"); equipmentCollider.enabled = false; if (respawnPoints.Length == 0) { Debug.Log("There aren't any respawn points, you catastrophic dingus."); } respawnPointsTeamA = GameObject.FindGameObjectsWithTag ("RespawnPointTeamA"); respawnPointsTeamB = GameObject.FindGameObjectsWithTag ("RespawnPointTeamB"); paint = GetComponent<PaintSplatter>(); // paint.color = c1; hitForce = 25; }
void Start() { // Get Components and Game Objects respawnPoints = GameObject.FindGameObjectsWithTag("RespawnPoint"); if (respawnPoints.Length == 0) { Debug.Log("There aren't any respawn points, you catastrophic dingus."); } sound = GetComponent<AudioSource>(); cam = Camera.main.GetComponent<OverheadCameraController>(); rb = GetComponent<Rigidbody>(); anim = GetComponent <Animator>(); equipmentCollider = GetComponentsInChildren<CapsuleCollider> ()[1]; // 0 returns collider on THIS object equipmentCollider.enabled = false; paint = GetComponent<PaintSplatterProjector> (); proj = GetComponentInChildren<Projector>(); Debug.Log("My projector is " + proj); paint.Initialize (color); // Set up color variables GetComponent<Renderer>().material.color = color; SetColorToParent[] kids = GetComponentsInChildren<SetColorToParent>(); Debug.Log("Kids length: " + kids.Length); foreach (SetColorToParent s in kids) { s.ResetColor(color); } colorChangeToUniform = false; colorLerpT = 0; // Set up general player variables alive = true; anim.SetBool("Alive", true); ResetRigidBodyConstraints(); walkSpeed = 10f; // Set up Golf specific variables swinging = false; putting = false; canRotateLeft = true; canRotateRight = true; stats.ResetStats (); }