Automated ability setting
This commit is contained in:
parent
bc5f57a0fb
commit
32ff450355
5 changed files with 135 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
||||||
id _name name_strref ulti alignment
|
id _name name_strref ulti alignment
|
||||||
0 "Notaire" "5" "0" "villager"
|
0 "Notaire" "5" "4" "villager"
|
||||||
1 "Chasseur" "6" "1" "villager"
|
1 "Chasseur" "6" "5" "villager"
|
||||||
2 "Marionetiste" "7" "2" "dark"
|
2 "Marionetiste" "7" "6" "dark"
|
||||||
3 "espion" "8" "3" "dark"
|
3 "espion" "8" "7" "dark"
|
||||||
|
|
|
@ -10400,8 +10400,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: 76b745b171184de4b9790ed6c5871a98, type: 3}
|
m_Script: {fileID: 11500000, guid: 76b745b171184de4b9790ed6c5871a98, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
spellID: 3
|
type: 0
|
||||||
ico: {fileID: 21300000, guid: 1b09e1b8c17acf847abcd18a59078ad9, type: 3}
|
|
||||||
--- !u!1 &900663497
|
--- !u!1 &900663497
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -22382,6 +22381,99 @@ Transform:
|
||||||
- {fileID: 200815965}
|
- {fileID: 200815965}
|
||||||
m_Father: {fileID: 536297868}
|
m_Father: {fileID: 536297868}
|
||||||
m_RootOrder: 2
|
m_RootOrder: 2
|
||||||
|
--- !u!1 &1922246851
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
serializedVersion: 4
|
||||||
|
m_Component:
|
||||||
|
- 4: {fileID: 1922246856}
|
||||||
|
- 33: {fileID: 1922246855}
|
||||||
|
- 65: {fileID: 1922246854}
|
||||||
|
- 23: {fileID: 1922246853}
|
||||||
|
- 114: {fileID: 1922246852}
|
||||||
|
m_Layer: 0
|
||||||
|
m_Name: MainPlayer
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!114 &1922246852
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1922246851}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 1747e8b9a8f0111409e8e9970a88305a, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
charID: 0
|
||||||
|
charname:
|
||||||
|
spellID: 0
|
||||||
|
hp: 0
|
||||||
|
roleID: 0
|
||||||
|
rolename_strref: 0
|
||||||
|
ultiID: 0
|
||||||
|
align:
|
||||||
|
--- !u!23 &1922246853
|
||||||
|
MeshRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1922246851}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_CastShadows: 1
|
||||||
|
m_ReceiveShadows: 1
|
||||||
|
m_Materials:
|
||||||
|
- {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_SubsetIndices:
|
||||||
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
|
m_UseLightProbes: 1
|
||||||
|
m_ReflectionProbeUsage: 1
|
||||||
|
m_ProbeAnchor: {fileID: 0}
|
||||||
|
m_ScaleInLightmap: 1
|
||||||
|
m_PreserveUVs: 1
|
||||||
|
m_ImportantGI: 0
|
||||||
|
m_AutoUVMaxDistance: .5
|
||||||
|
m_AutoUVMaxAngle: 89
|
||||||
|
m_LightmapParameters: {fileID: 0}
|
||||||
|
m_SortingLayerID: 0
|
||||||
|
m_SortingOrder: 0
|
||||||
|
--- !u!65 &1922246854
|
||||||
|
BoxCollider:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1922246851}
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_IsTrigger: 0
|
||||||
|
m_Enabled: 1
|
||||||
|
serializedVersion: 2
|
||||||
|
m_Size: {x: 1, y: 1, z: 1}
|
||||||
|
m_Center: {x: 0, y: 0, z: 0}
|
||||||
|
--- !u!33 &1922246855
|
||||||
|
MeshFilter:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1922246851}
|
||||||
|
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
|
||||||
|
--- !u!4 &1922246856
|
||||||
|
Transform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1922246851}
|
||||||
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
|
m_LocalPosition: {x: -22.4699993, y: 9.60999966, z: -33.6500015}
|
||||||
|
m_LocalScale: {x: 3.3179574, y: 3.31795716, z: 3.31795716}
|
||||||
|
m_Children: []
|
||||||
|
m_Father: {fileID: 0}
|
||||||
|
m_RootOrder: 6
|
||||||
--- !u!1 &1931121553
|
--- !u!1 &1931121553
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -24368,6 +24460,7 @@ GameObject:
|
||||||
- 222: {fileID: 2060081038}
|
- 222: {fileID: 2060081038}
|
||||||
- 114: {fileID: 2060081037}
|
- 114: {fileID: 2060081037}
|
||||||
- 114: {fileID: 2060081036}
|
- 114: {fileID: 2060081036}
|
||||||
|
- 114: {fileID: 2060081039}
|
||||||
m_Layer: 5
|
m_Layer: 5
|
||||||
m_Name: Button
|
m_Name: Button
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
@ -24461,6 +24554,18 @@ CanvasRenderer:
|
||||||
m_PrefabParentObject: {fileID: 0}
|
m_PrefabParentObject: {fileID: 0}
|
||||||
m_PrefabInternal: {fileID: 0}
|
m_PrefabInternal: {fileID: 0}
|
||||||
m_GameObject: {fileID: 2060081034}
|
m_GameObject: {fileID: 2060081034}
|
||||||
|
--- !u!114 &2060081039
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2060081034}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 76b745b171184de4b9790ed6c5871a98, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
type: 1
|
||||||
--- !u!1 &2070509345
|
--- !u!1 &2070509345
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -4,8 +4,11 @@ using System.Collections;
|
||||||
|
|
||||||
|
|
||||||
public class Gui_AbilityButton : MonoBehaviour{
|
public class Gui_AbilityButton : MonoBehaviour{
|
||||||
|
public enum AbilityType{
|
||||||
|
Spell, Ultimate
|
||||||
|
}
|
||||||
|
|
||||||
public int abilityID;
|
public AbilityType type;
|
||||||
|
|
||||||
void Awake(){
|
void Awake(){
|
||||||
button = GetComponent<Button>();
|
button = GetComponent<Button>();
|
||||||
|
@ -14,7 +17,14 @@ public class Gui_AbilityButton : MonoBehaviour{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Start(){
|
void Start(){
|
||||||
SetAbilityID(abilityID);
|
switch(type){
|
||||||
|
case AbilityType.Spell:
|
||||||
|
SetAbilityID(Game.Get().GetMainPlayer().spellID);
|
||||||
|
break;
|
||||||
|
case AbilityType.Ultimate:
|
||||||
|
SetAbilityID(Game.Get().GetMainPlayer().ultiID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetAbilityID(int _abilityID){
|
void SetAbilityID(int _abilityID){
|
||||||
|
@ -41,7 +51,8 @@ public class Gui_AbilityButton : MonoBehaviour{
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
private int i;
|
|
||||||
|
private int abilityID;
|
||||||
|
|
||||||
private Button button;
|
private Button button;
|
||||||
private Image icon;
|
private Image icon;
|
||||||
|
|
|
@ -3,19 +3,19 @@ using System.IO;
|
||||||
|
|
||||||
public class Game {
|
public class Game {
|
||||||
|
|
||||||
void SetMainPlayer(Player p){
|
public void SetMainPlayer(Player p){
|
||||||
m_mainPlayer = p;
|
m_mainPlayer = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Player GetMainPlayer(){
|
public Player GetMainPlayer(){
|
||||||
return m_mainPlayer;
|
return m_mainPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static Game Get() {
|
public static Game Get() {
|
||||||
lock(m_singlmutex) {
|
lock(m_singlmutex) {
|
||||||
if(m_inst==null)
|
if(m_inst==null)
|
||||||
m_inst = new Game();
|
m_inst = new Game();
|
||||||
|
|
|
@ -8,6 +8,13 @@ public class Player : MonoBehaviour {
|
||||||
SetRole(_roleID);
|
SetRole(_roleID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Awake(){
|
||||||
|
//Debug
|
||||||
|
SetCharacter(charID);
|
||||||
|
SetRole(roleID);
|
||||||
|
Game.Get().SetMainPlayer(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void DebugInfo() {
|
public void DebugInfo() {
|
||||||
Debug.Log(charname+" is a "+Rdb.GetStrRef(rolename_strref)+" with "+hp.ToString()+" hit points");
|
Debug.Log(charname+" is a "+Rdb.GetStrRef(rolename_strref)+" with "+hp.ToString()+" hit points");
|
||||||
|
|
Loading…
Add table
Reference in a new issue