// Use this for initialization void Start() { manager = GameObject.Find("LevelManagerO").GetComponent <LevelManager>(); copterScript = GameObject.Find("Copter").GetComponent <CopterManagerTouch> (); cargo = gameObject.transform.FindChild("Cargo"); copterMass = GetComponent <Rigidbody2D>().mass; }
// Use this for initialization void Start() { maxLifeTimeInSeconds = lifeTimeInSeconds; if (!inMenu) { Time.timeScale = 1f; manager = GameObject.Find("LevelManagerO").GetComponent <LevelManager> (); copterScript = GameObject.Find("Copter").GetComponent <CopterManagerTouch> (); cargoScript = GameObject.Find("Copter").GetComponent <CargoManager> (); } crate = gameObject.transform.parent.gameObject; animator = gameObject.transform.parent.GetComponent <Animator>(); //Debug.Log(animator.name); //spriteRenderer = crate.GetComponent<SpriteRenderer> (); /*if (crate.transform.FindChild ("BackGround") != null) * bgRenderer = crate.transform.FindChild ("BackGround").GetComponent<SpriteRenderer> ();*/ if (animator.GetInteger("status") == 0) { stationary = true; } else if (animator.GetInteger("status") == 1) { twoPhases = true; } else if (animator.GetInteger("status") == 3) { fourPhases = true; } floatyValue = gameObject.transform.parent.GetComponent <Rigidbody2D> ().mass * 30f; hinge = GetComponent <HingeJoint2D> (); }