コード例 #1
0
ファイル: SCR_Level.cs プロジェクト: rsofia/SignLanguage_Game
    public SCR_Level GetLevelFromDirection(DIRECTION direction)
    {
        SCR_Level result = null;

        if (!isBlocked)
        {
            switch (direction)
            {
            case DIRECTION.Up:
            { if (up != null && !up.isBlocked)
              {
                  result = up;
              }
            }
            break;

            case DIRECTION.Down:
            {
                if (down != null && !down.isBlocked)
                {
                    result = down;
                }
            }
            break;

            case DIRECTION.Left:
            {
                if (left != null && !left.isBlocked)
                {
                    result = left;
                }
            }
            break;

            case DIRECTION.Right:
            {
                if (right != null && !right.isBlocked)
                {
                    result = right;
                }
            }
            break;
            }
        }
        return(result);
    }
コード例 #2
0
    private void Start()
    {
        myRigidbody = GetComponent <Rigidbody>();
        if (myRenderer == null)
        {
            myRenderer = GetComponent <Renderer>();
        }
        levelProperties = FindObjectOfType <SCR_Level>();
        timer           = FindObjectOfType <SCR_Timer>();
        AssignRandomColor();

        winMenu.SetActive(false);
        lostMenu.SetActive(false);

        source             = GetComponent <AudioSource>();
        source.playOnAwake = false;
        source.loop        = false;
    }
コード例 #3
0
ファイル: SCR_Level.cs プロジェクト: rsofia/SignLanguage_Game
 protected void DrawLine(SCR_Level pin)
 {
     Gizmos.color = Color.blue;
     Gizmos.DrawLine(transform.position, pin.transform.position);
 }