OneWayPlatform.Start C# (CSharp) Method

Start() public method

public Start ( ) : void
return void
    void Start()
    {
        playerObject = GameObject.FindWithTag("P1");
        BoxCollider2D myCollider = gameObject.GetComponent<BoxCollider2D>();
        Vector2 size = myCollider.size;
        Vector2 center = myCollider.center;

        minX = center.x - (size.x / 2f) + gameObject.transform.position.x;
        maxX = center.x + (size.x / 2f) + gameObject.transform.position.x;
        minY = center.y - (size.y / 2f) + gameObject.transform.position.y;
        maxY = center.y + (size.y / 2f) + gameObject.transform.position.y;

        topL = new Vector2 (minX, maxY);
        botR = new Vector2 (maxX, minY);

        platBox = gameObject.transform;
        platCollider = gameObject.GetComponent<BoxCollider2D>();
        platColSize = platCollider.size;
        platColCntr = platCollider.center;

        playerObject = GameObject.FindWithTag("P1");

        platX = platBox.position.x;
        platY = platBox.position.y;
        width = platBox.localScale.x * platCollider.size.x;
        height = platBox.localScale.y * platCollider.size.y;

        if (oneDisable) {
            oneDisable = false;
                        this.enabled = false;
                }
    }