本文整理汇总了C#中PlatformType类的典型用法代码示例。如果您正苦于以下问题:C# PlatformType类的具体用法?C# PlatformType怎么用?C# PlatformType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlatformType类属于命名空间,在下文中一共展示了PlatformType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Setup
public void Setup(PlatformType? type = null)
{
Type = type == null ? GetRandomType() : type.Value;
switch (Type)
{
case PlatformType.Deafult:
gameObject.renderer.material.color = Color.white;
break;
case PlatformType.HighBounce:
Boost *= 1.33f;
gameObject.renderer.material.color = Color.blue;
break;
case PlatformType.LowBounce:
Boost /= 2;
gameObject.renderer.material.color = Color.red;
break;
case PlatformType.QuadrupleMoney:
Money *= 4;
gameObject.renderer.material.color = Color.yellow;
break;
case PlatformType.MovingHorizontal:
gameObject.renderer.material.color = Color.green;
gameObject.AddComponent<MoveBackAndForth>();
break;
}
}
示例2: InitPlatform
public static void InitPlatform()
{
Type = PlatformType.UNKNOWN;
switch (Environment.OSVersion.Platform)
{
case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
case PlatformID.WinCE:
Type = PlatformType.WINDOWS;
break;
case PlatformID.MacOSX:
Type = PlatformType.MAC;
break;
}
if(Type == PlatformType.UNKNOWN)
{
int platformCode = (int)Environment.OSVersion.Platform;
if (platformCode == 4 || platformCode == 6 || platformCode == 128)
{
Type = PlatformType.LINUX;
}
}
}
示例3: CreateMessageData
public static MessageData CreateMessageData(Guid msgid, PlatformType platform, string tellerno, string orgno, int msgbiztype, byte[] codemsg)
{
MessageData msgdata = new MessageData { MessageID = msgid, FirstTime = DateTime.Now, TragetPlatform = platform, TellerNO = tellerno, OrgNO=orgno, MsgBizType=msgbiztype, ReSentTime = 0 };
msgdata.ReqPackageList.Enqueue(new PackageData(1, codemsg));
msgdata.IsMultiPackage = false;
return msgdata;
}
示例4: InitPlatform
/// <summary>
/// Determines the current platform
/// </summary>
public static void InitPlatform()
{
switch (Environment.OSVersion.Platform)
{
case PlatformID.Unix:
Type = (
Directory.Exists("/Applications")
&& Directory.Exists("/System")
&& Directory.Exists("/Users")
&& Directory.Exists("/Volumes")
) ? PlatformType.MAC : PlatformType.LINUX;
break;
case PlatformID.MacOSX:
Type = PlatformType.MAC;
break;
case PlatformID.Win32NT:
case PlatformID.Win32S:
case PlatformID.Win32Windows:
case PlatformID.WinCE:
case PlatformID.Xbox:
Type = PlatformType.WINDOWS;
break;
default:
Type = PlatformType.UNKNOWN;
break;
}
}
示例5: Register
public void Register(string deviceModel, PlatformType platformType, string carrier, string platformOS, int timeZoneOffset, string locale, string manufac, Tuple<int, int> resolution)
{
DeviceInfo deviceInfo = new DeviceInfo()
{
Model = deviceModel,
PlatformType = platformType,
Carrier = carrier,
OperatingSystem = platformOS,
TimeZoneOffset = timeZoneOffset,
Locale = locale,
ResolutionHeight = resolution.Item1,
ResolutionWidth = resolution.Item2,
Manufactorer = manufac,
DateCreated = this.DateCreated,
Date = this.DateCreated.Date
};
ApplicationInfo applicationInfo = new ApplicationInfo()
{
ApplicationId = applicationId,
Version = this.Version
};
deviceService.Log(deviceInfo, applicationInfo);
DeviceId = deviceInfo.Guid;
}
示例6: PlatformInfo
public PlatformInfo(PlatformType platform, Version version)
{
Should.NotBeNull(platform, nameof(platform));
Should.NotBeNull(version, nameof(version));
_platform = platform;
_version = version;
}
示例7: AssemblyProcessorContext
public AssemblyProcessorContext(BaseAssemblyResolver assemblyResolver, AssemblyDefinition assembly, PlatformType platform, TextWriter log)
{
AssemblyResolver = assemblyResolver;
Assembly = assembly;
Platform = platform;
Log = log;
}
示例8: Update
// Update is called once per frame
void Update()
{
Transform lastChild = transform.GetChild (transform.childCount - 1);
int auxBeginPercent = 0;
int auxEndPercent = 0;
int randomValue = Random.Range (0, 100);
PlatformType randomType = new PlatformType ();
foreach (PlatformType PlatformType in PlatformsTypes) {
auxEndPercent += PlatformType.Percent;
if (randomValue >= auxBeginPercent && auxBeginPercent < auxEndPercent)
randomType = PlatformType;
auxBeginPercent += PlatformType.Percent;
}
if (lastChild.position.x + 2 - transform.position.x < 0) {
GameObject NewObject = Instantiate (SpawnObjects [0], lastChild.position + new Vector3 (2 + randomType.Width, -lastChild.position.y - (Speed > 0 ? 4.5f : -4.5f) + randomType.Height, 0), transform.rotation) as GameObject;
if(Random.Range(0, 100) < 10 && CurrentGameState == GameManager.GameState.Resume)
NewObject.transform.GetChild(NewObject.transform.childCount - 1).gameObject.SetActive(true);
int randomGravityValue = Random.Range (0, 100);
NewObject.transform.parent = transform;
NewObject.transform.SendMessage ("SetSpeed", Speed);
}
}
示例9: CancelAuthorize
public override void CancelAuthorize(PlatformType platform)
{
if (ssdk != null)
{
ssdk.Call("removeAccount", (int)platform);
}
}
示例10: PlatformInfo
public PlatformInfo(PlatformType platform, Version version)
{
Should.NotBeNull(platform, "platform");
Should.NotBeNull(version, "version");
_platform = platform;
_version = version;
}
示例11: GetAuthorizeConfig
/// <summary>
/// Get authorize config by platform type
/// </summary>
/// <param name="platformType">Soical PlatformType</param>
/// <returns>Authorize Config Value</returns>
public AuthorizeConfig GetAuthorizeConfig(PlatformType platformType)
{
AuthorizeConfig authorizeConfig = null;
StreamResourceInfo configFile = Application.GetResourceStream(new Uri("/MoCommon;component/Social/SocialConfig.xml", UriKind.RelativeOrAbsolute));
XDocument configDoc = XDocument.Load(configFile.Stream);
XElement queryElement = null;
#region read config content from xml file
switch (platformType)
{
case PlatformType.Tencent:
queryElement = configDoc.Elements("social").First().Elements("tencent").First();
break;
case PlatformType.Sina:
queryElement = configDoc.Elements("social").First().Elements("sina").First();
break;
case PlatformType.WeChat:
queryElement = configDoc.Elements("social").First().Elements("wechat").First();
break;
}
authorizeConfig = new AuthorizeConfig()
{
PlatformType = platformType,
AppKey = queryElement.Attributes().Single(x => x.Name == "appkey").Value,
AppSecret = queryElement.Attributes().Single(x => x.Name == "appsecret").Value,
Url = queryElement.Attributes().Single(x => x.Name == "url").Value,
RedirectUrl = queryElement.Attributes().Single(x => x.Name == "redirecturl").Value,
ApiUrl = queryElement.Attributes().Single(x => x.Name == "apiurl").Value,
OauthApiUrl = queryElement.Attributes().Single(x => x.Name == "oauthapiurl").Value
};
#endregion
return authorizeConfig;
}
示例12: Config
private Config()
{
currPlatform = PlatformType.iOS;
gameVersion = "1.0"; // also change in unity editor
serverUrl = "http://personalizedgift.uehelp.com/";
gameTitle = "Danjur";
}
示例13: Authorize
public override void Authorize(int reqID, PlatformType platform)
{
Debug.Log("AndroidUtils ===>>> Authorize" );
if (ssdk != null)
{
ssdk.Call("authorize", reqID, (int)platform);
}
}
示例14: AddFriend
public override void AddFriend(int reqID, PlatformType platform, String account)
{
Debug.Log("AndroidUtils ===>>> FollowFriend" );
if (ssdk != null)
{
ssdk.Call("followFriend", reqID, (int)platform, account);
}
}
示例15: DeviceUpgradeSummary
public DeviceUpgradeSummary(string version, DateTime date, Guid applicationId, PlatformType platformType)
{
this.Version = version;
this.Date = date;
this.ApplicationId = applicationId;
this.PlatformType = platformType;
this.Count += 1;
}