void Start() { if (GameObject.Find("Sphere")) { _surface = GameObject.Find("Sphere").GetComponent <SurfaceAttractor>(); } }
/////////////////////////////////////////////////////////////// void Start() { _surfaceAttractor = playSurface.GetComponent <SurfaceAttractor>(); _surfaceMesh = playSurface.GetComponent <MeshDeformer>(); _audioManager = GameObject.FindGameObjectWithTag("AudioManager"); _rb = this.GetComponent <Rigidbody>(); _isPlane = _surfaceAttractor.isPlane(); // Ignore the raycast layer Physics.IgnoreCollision(GetComponent <Collider>(), GameObject.Find("MouseRaycastCollider").GetComponent <Collider>()); _anim = GetComponent <Animator>(); _anim.SetBool("_Alive", _alive); _respawnPoint = new Vector3(0, 0, 0); }