コード例 #1
0
ファイル: scr_ground.cs プロジェクト: JRSerjeant/GGJ2016
    void OnTriggerEnter2D(Collider2D otherObject)
    {
        if (currentState == groundState.Falling)
        {
            if (otherObject.gameObject == RayObject)
            {
                currentState = groundState.Static;
                gameObject.layer = 0;
                this.transform.position = new Vector3(RayObject.transform.position.x, RayObject.transform.position.y + GetComponent<BoxCollider2D>().bounds.size.y);
                GetComponent<BoxCollider2D>().isTrigger = false;
            }

            if (otherObject.tag == "LittleMen")
            {
                squashSFX.Play();
            }
        }

    }
コード例 #2
0
ファイル: scr_ground.cs プロジェクト: JRSerjeant/GGJ2016
 public void SetStateFalling()
 {
     Debug.Log("SetStateFalling()");
     currentState = groundState.Falling;
     GetComponent<BoxCollider2D>().isTrigger = true;
     SetAboveFalling();
     //UnityEditor.EditorApplication.isPaused = true;
 }