예제 #1
0
파일: LevelBlock.cs 프로젝트: klEx0n/DIaM
    // Use this for initialization
    void Start()
    {
        handler = GameObject.FindGameObjectWithTag("GameController").GetComponent<LevelBlockHandler>();
        transform.parent = handler.transform;

        // This Loop is used to calculate the Size of the LevelBlock (the childrin inside)
        // the Size is used for the next Positioning
        for(int i = 0; i < transform.childCount; i++)
        {
            if(transform.GetChild(i).tag == "Ground")
            {
                if(transform.GetChild(i).GetComponent<BoxCollider2D>() != null)
                    // childrenLenght is used for the reposition
                    childrenLength += transform.GetChild(i).GetComponent<BoxCollider2D>().size.y;
            }
        }
    }
예제 #2
0
파일: FallHandler.cs 프로젝트: klEx0n/DIaM
 // Use this for initialization
 void Start()
 {
     // Get needed Objects
     levelHandler = GameObject.FindGameObjectWithTag("GameController").GetComponent<LevelBlockHandler>();
     grounded = GameObject.FindGameObjectWithTag("GroundChk").GetComponent<GroundCheck>();
 }