//
    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;

        //
    }
Ejemplo n.º 2
0
    void Start()
    {
        messagecontrols = FindObjectOfType <MessageController>();
        rigidBody       = GetComponent <Rigidbody2D>();
        playerAnimation = GetComponent <Animator>();
        afterflightCC   = FindObjectOfType <AfterFlightCollisionController>();
        navscripts      = FindObjectOfType <NavScripts>();
        audiomanager    = AudioManager.instance;
        scorecount      = FindObjectOfType <ScoreCounter>();
        respawnpoint    = FindObjectOfType <RespawnPointControls>();
        loadscene       = FindObjectOfType <LoadScene>();
        scorecounter    = FindObjectOfType <ScoreCounter>();
        helpcontrol     = FindObjectOfType <HelpController>();
        if (isReloaded)
        {
            //Debug.Log(shouldShowHelp);
            //Debug.Log(respawnpoint.GetRespawnPoint());
            this.transform.position = respawnpoint.GetRespawnPoint();

            //if (shouldShowHelp)
            //{
            /// StartCoroutine(MessageShow());
            // shouldShowHelp = false;
            //}
            isReloaded = false;
        }
        levelNav = FindObjectOfType <LevelNavControl>();
    }
Ejemplo n.º 3
0
 void Start()
 {
     rigidBody       = GetComponent <Rigidbody2D>();
     playerAnimation = GetComponent <Animator>();
     afterflightCC   = FindObjectOfType <AfterFlightCollisionController>();
     navscripts      = FindObjectOfType <NavScripts>();
 }
Ejemplo n.º 4
0
    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;
    }
Ejemplo n.º 5
0
 // 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");
 }
Ejemplo n.º 6
0
    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>();
    }