예제 #1
0
    void HandleTetrominoOverlap()
    {
        while (true)
        {
            CollisionTarget overlapedObject = gameGrid.CheckHasOverlapAtPos(Vector2.zero);
            if (overlapedObject == CollisionTarget.None)
            {
                gameGrid.UpdateGrid();
                return;
            }

            switch (overlapedObject)
            {
            case CollisionTarget.GridLeft:
                currentTetromino.transform.position += new Vector3(1.0f, 0.0f, 0.0f);
                break;

            case CollisionTarget.GridRight:
                currentTetromino.transform.position += new Vector3(-1.0f, 0.0f, 0.0f);
                break;

            case CollisionTarget.GridDown:
            case CollisionTarget.Mino:
                currentTetromino.transform.position += new Vector3(0.0f, 1.0f, 0.0f);
                break;
            }
        }
    }
예제 #2
0
    private void OnTriggerEnter(Collider other)
    {
        switch (other.gameObject.tag)
        {
        case "DeadZone":
            _targets |= CollisionTarget.Dead;
            break;

        case "GoalZone":
            _targets |= CollisionTarget.Goal;
            break;
        }
    }
예제 #3
0
 public bool IsCollisionWith(CollisionTarget target)
 {
     return((_targets & target) == target);
 }
예제 #4
0
 void Start()
 {
     _targets = CollisionTarget.None;
 }
예제 #5
0
 void Start()
 {
     collTarget  = GameObject.FindGameObjectWithTag("Aim").GetComponent <CollisionTarget>();
     gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>();
 }
예제 #6
0
파일: ACollider.cs 프로젝트: rennone/Katana
 bool CollidableTo(CollisionTarget mask)
 {
     return ignores.Contains(mask) == false;
 }
예제 #7
0
 private bool IsCollisionWith(CollisionTarget target)
 {
     return(_ballGameObject.GetComponent <BallCollisionChecker>()?.IsCollisionWith(target) ?? false);
 }