コード例 #1
0
    void TouchCell(Vector3 position)
    {
        position = transform.InverseTransformPoint(position);
        CellCoords coordinates = CellCoords.FromPosition(position);

        Debug.Log("daddy touched me at " + coordinates.ToString());
    }
コード例 #2
0
    //Converts touch position to cell coordinates via the CellCoords script
    void TouchCell(Vector3 position)
    {
        position = transform.InverseTransformPoint(position);
        CellCoords coordinates = CellCoords.FromPosition(position);

        Debug.Log("contact at " + coordinates.ToString());
        int index             = coordinates.X + coordinates.Y * width;
        SquareCellScript cell = cells[index];

        cell.color = touchedColor;
    }
コード例 #3
0
    public override void OnGUI(
        Rect position, SerializedProperty property, GUIContent label
        )
    {
        CellCoords coordinates = new CellCoords(
            property.FindPropertyRelative("x").intValue,
            property.FindPropertyRelative("y").intValue
            );

        position = EditorGUI.PrefixLabel(position, label);
        GUI.Label(position, coordinates.ToString());
    }