// Use this for initialization void Start () { playerHeart = GameObject.FindObjectOfType<PlayerHeart>(); boomBitch = GetComponent<PointEffector2D>(); fireAbilityParticle = GetComponent<ParticleSystem>(); emission = fireAbilityParticle.emission; emission.enabled = false; boomBitch.enabled = false; firePlayer = GameObject.FindObjectOfType<Player>(); fireBall = GameObject.FindObjectOfType<FireBall>(); theGrad = fireAbilityParticle.colorOverLifetime; grads = GetComponent<FlickerGradients>(); }
//hmm...what's this for? void Start() { //when you reload a scene if you don't reset the particles sometimes they //are added or not reset correctly, so...bam, fixed ParticleSystem[] pses = GetComponentsInChildren<ParticleSystem>(); foreach(ParticleSystem ps in pses) { ps.Clear(); } heartSystemScript = FindObjectOfType<PlayerHeart>(); FIREUIScript = FindObjectOfType<FIRE>(); sweetHeart = GameObject.Find("SweetHeartLife"); canLight = false; fireTail = GameObject.Find("FireTail").GetComponent<ParticleSystem>(); makeMeBig = GameObject.Find("IWannaBeBig").GetComponent<ParticleSystem>(); makeMeSmall = GameObject.Find("IWannaBeSmall").GetComponent<ParticleSystem>(); makeMeSmallIfForced = GameObject.Find("SmallForced").GetComponent<ParticleSystem>(); teleportBam = GameObject.Find("TeleportBam").GetComponent<ParticleSystem>(); fireStandard = GameObject.Find("FireAbilityStandard"); flicker = GameObject.Find("Flicker"); flickerGradient = flicker.GetComponent<ParticleSystem>().colorOverLifetime; flickerScript = flicker.GetComponent<FlickerGradients>(); flickerHeart = GameObject.Find("FlickerHeart"); flickerHeartGradient = flickerHeart.GetComponent<ParticleSystem>().colorOverLifetime; flickerHeartScript = flickerHeart.GetComponent<FlickerGradients>(); torchGradient = fireTail.colorOverLifetime; torchScript = fireTail.GetComponent<FlickerGradients>(); explosionGradient = makeMeBig.colorOverLifetime; explosionScript = makeMeBig.GetComponent<FlickerGradients>(); fireEmission = fireTail.emission; fireShape = fireTail.shape; distanceGreatEnough = true; sexyBody = GetComponent<Rigidbody2D>(); unkillAbleDest = true; beatLevelTime = int.MaxValue; hasJoystick = Input.GetJoystickNames().Length > 0; Debug.Log(hasJoystick); SizeFix(); }