Skip to content

Commit 9af8e95

Browse files
committed
feat: Added missing datatypess and widgets class for websockets
1 parent 21800ad commit 9af8e95

File tree

6 files changed

+781
-0
lines changed

6 files changed

+781
-0
lines changed

Utilities/Utility.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,15 @@ public static List<string> GetCredentialsPaths()
12481248
return filePathsToLoad;
12491249
}
12501250
#endregion
1251+
1252+
#region String to Double
1253+
public static double StringToDouble(string input)
1254+
{
1255+
double output;
1256+
double.TryParse(input, out output);
1257+
return output;
1258+
}
1259+
#endregion
12511260
}
12521261

12531262
/// <summary>

Widgets.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Widgets/DataTypes.cs

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/**
2+
* Copyright 2015 IBM Corp. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
using IBM.Cloud.SDK.Utilities;
19+
using IBM.Cloud.SDK.Widgetss;
20+
using UnityEngine;
21+
22+
namespace IBM.Cloud.SDK.DataTypes
23+
{
24+
/// <summary>
25+
/// This class holds a AudioClip and maximum sample level.
26+
/// </summary>
27+
public class AudioData : Widget.Data
28+
{
29+
/// <summary>
30+
/// Default constructor.
31+
/// </summary>
32+
public AudioData()
33+
{ }
34+
35+
/// <exclude />
36+
~AudioData()
37+
{
38+
UnityObjectUtil.DestroyUnityObject(Clip);
39+
}
40+
41+
/// <summary>
42+
/// Constructor.
43+
/// </summary>
44+
/// <param name="clip">The AudioClip.</param>
45+
/// <param name="maxLevel">The maximum sample level in the audio clip.</param>
46+
public AudioData(AudioClip clip, float maxLevel)
47+
{
48+
Clip = clip;
49+
MaxLevel = maxLevel;
50+
}
51+
/// <summary>
52+
/// Name of this data type.
53+
/// </summary>
54+
/// <returns>The readable name.</returns>
55+
public override string GetName()
56+
{
57+
return "Audio";
58+
}
59+
60+
/// <summary>
61+
/// The AudioClip.
62+
/// </summary>
63+
public AudioClip Clip { get; set; }
64+
/// <summary>
65+
/// The maximum level in the audio clip.
66+
/// </summary>
67+
public float MaxLevel { get; set; }
68+
}
69+
}

Widgets/DataTypes.cs.meta

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)