/// // Use this for initialization void Start() { lorentzContractionForJenny = LorentzContractionForJenny.lCJenny; //GetComponent ("LorentzContractionForJenny") as LorentzContractionForJenny; jennyTime = 0.0f; }
void Awake() { //makes it a singleton if (lCJenny == null) { lCJenny = this; } else if (lCJenny != this) { Destroy(gameObject); } }
void Start() { controller = PlatformerController.platformerController; lorentzContractionForJenny = LorentzContractionForJenny.lCJenny; SpeedOfLight = GameControl.control.SpeedOfLight; impactAudio = gameObject.AddComponent <AudioSource>(); impactAudio.clip = impactSound; impactAudio.volume = 0.2f; impactAudio.playOnAwake = false; timeOfBounce = 0f; }
//A start function void Start() { SpeedOfLight = GameControl.control.SpeedOfLight; SpeedOfLightY = GameControl.control.SpeedOfLightY; SpeedOfJump = GameControl.control.jumpSpeed; jennyTransform.GetComponent <Rigidbody2D>().gravityScale = GameControl.control.gravity; MaxNumbOfJumps = GameControl.control.maxNumberOfJumps; movement.maxFallSpeed = SpeedOfLightY; // get the distance to ground distToGround = jennyTransform.GetComponent <Collider2D>().bounds.extents.y; DeltaGamma = GameControl.control.deltaGamma; /////////// ////These are used for pick up ////////// holdingSomething = false; //DeltaXShift=1.0f; gammaX = 1.0f; gammaX0ld = 1.0f; riseTime = 0.5f; lorentzContractionForJenny = gameObject.GetComponent("LorentzContractionForJenny") as LorentzContractionForJenny; jennyShoot = gameObject.GetComponent("JennyShoot") as JennyShoot; levelDisplay = GameObject.FindGameObjectWithTag("Canvas").GetComponent("LevelDisplay") as LevelDisplay; jennyTime = 0.0f; //These are needed for the delay period between boosts timeBetweenBoosts = 0.5f; oneOverTimeBetweenBoosts = 1.0f / timeBetweenBoosts; small1OverTimeBetweenBoosts = 1.0f / smallTimeBetweenBoosts; timeOfBoost = 0.0f; ratioOfTimes = 0.0f; //boostDial= GameObject.Find("GreenCircle"); boostDial = GameObject.Find("BoostRecovery"); }