V3.3.2 LevelProbabilityPanel初始化完成
LevelProbabilityPanel初始化完成 独立Target enum类
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public static class targetTypeExtensions
|
||||
{
|
||||
public static int ToIndex(this Targets targetType)
|
||||
{
|
||||
switch (targetType)
|
||||
{
|
||||
case Targets.Go:
|
||||
return 0;
|
||||
case Targets.Attack:
|
||||
return 1;
|
||||
case Targets.Defence:
|
||||
return 2;
|
||||
default:
|
||||
Debug.LogError("ToIndex:targetType not found!");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static Targets ToTargetType(this int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 0:
|
||||
return Targets.Go;
|
||||
case 1:
|
||||
return Targets.Attack;
|
||||
case 2:
|
||||
return Targets.Defence;
|
||||
default:
|
||||
Debug.LogError("ToTargetType:index out of range!");
|
||||
return Targets.Go;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cb4bd090287d8da47959d417e9234626
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user