// void Start() { slab = GetComponent<BoxCollider2D>(); playercontrol = FindObjectOfType<PlayerControls>(); playermovement = FindObjectOfType<PlayerMovements>(); weightcontrol = FindObjectOfType<weightController>(); leveLength = GetComponent<BoxCollider2D>(); areaeffector = GetComponent<AreaEffector2D>(); afterflightCC = FindObjectOfType<AfterFlightCollisionController>(); load = GameObject.Find("Load_2"); load.GetComponent<Renderer>().enabled = false; areaeffector.enabled = false; player = GameObject.Find("Player"); seeSawHinge = GetComponent<HingeJoint2D>(); seeSawHinge.enabled = false; this.gameObject.GetComponent<Rigidbody2D>().isKinematic = true; // slabWidth = GetComponent<BoxCollider2D>().size.x; //Debug.Log("slabWidth" + slabWidth ); fulcrumObj = GameObject.FindWithTag("Fulcrum"); fulcrum_Start_x = fulcrumObj.transform.position.x; //Debug.Log("fulcrum at start: " + fulcrum_Start_x); anchor_y = seeSawHinge.anchor.y; // }
void Start() { //Debug.Log("Start called"); slab = GetComponent<BoxCollider2D>(); playercontrol = FindObjectOfType<PlayerControls>(); playermovement = FindObjectOfType<PlayerMovements>(); weightcontrol = FindObjectOfType<weightController>(); leveLength = GetComponent<BoxCollider2D>(); areaeffector = GetComponent<AreaEffector2D>(); afterflightCC = FindObjectOfType<AfterFlightCollisionController>(); //load = GameObject.Find("Loads/Load_2"); load = this.transform.parent.GetChild(2).GetChild(0).gameObject; load.GetComponent<Renderer>().enabled = false; areaeffector.enabled = false; player = GameObject.Find("Player"); seeSawHinge = GetComponent<HingeJoint2D>(); seeSawHinge.enabled = false; this.gameObject.GetComponent<Rigidbody2D>().isKinematic = true; // slabWidth = GetComponent<BoxCollider2D>().size.x; //Debug.Log("slabWidth" + slabWidth ); fulcrumObj = GameObject.FindWithTag("Fulcrum"); fulcrum_Start_x = fulcrumObj.transform.position.x; //Debug.Log("fulcrum at start: " + fulcrum_Start_x); anchor_y = seeSawHinge.anchor.y; messagecontrol = FindObjectOfType<MessageController>(); //Reset the static variable as flight control is dependent on this variable and if not reset gives issues with sound AfterFlightCollisionController.hasPlayerLanded = false; activateFly = false; }
// Start is called before the first frame update void Start() { playermovement = FindObjectOfType <PlayerMovements>(); playercontrol = FindObjectOfType <PlayerControls>(); weightcontrol = FindObjectOfType <weightController>(); load = GameObject.Find("Load_1"); load.GetComponent <Renderer>().enabled = false; leveLength = GetComponent <BoxCollider2D>(); areaeffector = GetComponent <AreaEffector2D>(); afterflightCC = FindObjectOfType <AfterFlightCollisionController>(); areaeffector.enabled = false; player = GameObject.Find("Player"); }
void Start() { playermovement = FindObjectOfType <PlayerMovements>(); playercontrol = FindObjectOfType <PlayerControls>(); weightcontrol = FindObjectOfType <weightController>(); //load = GameObject.Find("Load_1");//Lever_1 loadCount = this.transform.parent.GetChild(2).childCount; for (var i = 0; i < loadCount; i++) { this.transform.parent.GetChild(2).GetChild(i).gameObject.GetComponent <Renderer>().enabled = false; } //load = this.transform.parent.GetChild(2).GetChild(1); //load.GetComponent<Renderer>().enabled = false; leveLength = GetComponent <BoxCollider2D>(); areaeffector = GetComponent <AreaEffector2D>(); afterflightCC = FindObjectOfType <AfterFlightCollisionController>(); areaeffector.enabled = false; player = GameObject.Find("Player"); //weightText = GameObject.Find("ClickWeightText"); messagecontrol = FindObjectOfType <MessageController>(); }