Commit a3637f3d authored by 赤子奈落's avatar 赤子奈落

new select highlight effects and fixing that field do not refresh in record

parent 7d61ad4b
...@@ -36,22 +36,29 @@ public class LoadAssets : MonoBehaviour ...@@ -36,22 +36,29 @@ public class LoadAssets : MonoBehaviour
public static GameObject guide_near; public static GameObject guide_near;
public static GameObject guide_far; public static GameObject guide_far;
void Awake() static LoadAssets instance;
private void Awake()
{
instance = this;
Ini();
}
public static LoadAssets I()
{
return instance;
}
public void Ini()
{ {
ac = GameObject.Find("new_gameField(Clone)/Assets_Loader").GetComponent<AnimationControl>(); ac = GameObject.Find("new_gameField(Clone)/Assets_Loader").GetComponent<AnimationControl>();
CreateField1(Config.Get("Field0", "随机")); CreateField1(Config.Get("Field0", "随机"));
CreateField2(Config.Get("Field1", "随机")); CreateField2(Config.Get("Field1", "随机"));
CreatePhaseButton(); CreatePhaseButton();
//Debug.Log(Program.I().ocgcore.condition); //Debug.Log(Program.I().ocgcore.condition);
if (Program.I().ocgcore.condition == Ocgcore.Condition.duel || Program.I().ocgcore.condition == Ocgcore.Condition.watch)
{
CreateTimer();
CreateGuide();
}
ABLoader.LoadAB("bg/celestialsphere_c001", transform); ABLoader.LoadAB("bg/celestialsphere_c001", transform);
} }
static void CreateTimer() public static void CreateTimer()
{ {
var timer = ABLoader.LoadAB("bg/timer/timer_c001"); var timer = ABLoader.LoadAB("bg/timer/timer_c001");
Transform timerPart = timer.transform.Find("Timer"); Transform timerPart = timer.transform.Find("Timer");
...@@ -74,7 +81,7 @@ public class LoadAssets : MonoBehaviour ...@@ -74,7 +81,7 @@ public class LoadAssets : MonoBehaviour
phaseButton.AddComponent<PhaseButtonHandler>(); phaseButton.AddComponent<PhaseButtonHandler>();
} }
static void CreateGuide() public static void CreateGuide()
{ {
guide_near = ABLoader.LoadAB("bg/timer/playableguide_c001_near"); guide_near = ABLoader.LoadAB("bg/timer/playableguide_c001_near");
guide_near.transform.SetParent(field1_, false); guide_near.transform.SetParent(field1_, false);
......
...@@ -205,11 +205,11 @@ public class Shortcuts : MonoBehaviour ...@@ -205,11 +205,11 @@ public class Shortcuts : MonoBehaviour
hasChanged = false; hasChanged = false;
} }
//Time.timeScale = timescale; Time.timeScale = timescale;
//if (message != Program.I().ocgcore.currentMessage) if (message != Program.I().ocgcore.currentMessage)
//{ {
// message = Program.I().ocgcore.currentMessage; message = Program.I().ocgcore.currentMessage;
// Debug.Log(message); Debug.Log(message);
//} }
} }
} }
...@@ -11,7 +11,7 @@ public class TestLoad : MonoBehaviour ...@@ -11,7 +11,7 @@ public class TestLoad : MonoBehaviour
{ {
void Start() void Start()
{ {
var a1 = ABLoader.LoadAB("effects/summon/fxp_somldg/hand/fxp_somldg_hand_001"); var a1 = ABLoader.LoadABFolder("effects/other");
} }
} }
...@@ -2709,17 +2709,20 @@ public class Ocgcore : ServantWithCardDescription ...@@ -2709,17 +2709,20 @@ public class Ocgcore : ServantWithCardDescription
if (isObserver) if (isObserver)
{ {
if (condition != Condition.watch) shiftCondition(Condition.watch); if (condition != Condition.watch) shiftCondition(Condition.watch);
Program.I().setting.RefreshAppearance();
} }
else else
{ {
if (condition != Condition.duel) shiftCondition(Condition.duel); if (condition != Condition.duel) shiftCondition(Condition.duel);
LoadAssets.CreateTimer();
LoadAssets.CreateGuide();
} }
} }
else else
{ {
if (condition != Condition.record) shiftCondition(Condition.record); if (condition != Condition.record) shiftCondition(Condition.record);
Program.I().setting.RefreshAppearance();
} }
card = GCS_cardGet(new GPS card = GCS_cardGet(new GPS
{ {
controller = 0, controller = 0,
...@@ -3641,7 +3644,9 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3641,7 +3644,9 @@ public class Ocgcore : ServantWithCardDescription
ES_min = r.ReadUInt16(); ES_min = r.ReadUInt16();
count = r.ReadByte(); count = r.ReadByte();
GameObject decoration = ABLoader.LoadAB("effects/other/fxp_arrow_aim_001"); GameObject decoration = ABLoader.LoadAB("effects/hitghlight/fxp_hl_select/fxp_hl_select_card_001");
var main = decoration.GetComponent<ParticleSystem>().main;
main.playOnAwake = true;
for (var i = 0; i < count; i++) for (var i = 0; i < count; i++)
{ {
code = r.ReadInt32(); code = r.ReadInt32();
...@@ -3662,6 +3667,10 @@ public class Ocgcore : ServantWithCardDescription ...@@ -3662,6 +3667,10 @@ public class Ocgcore : ServantWithCardDescription
card.selectPtr = i; card.selectPtr = i;
card.forSelect = true; card.forSelect = true;
//card.add_one_decoration(Program.I().mod_ocgcore_decoration_card_selecting, 4, Vector3.zero, "card_selecting"); //card.add_one_decoration(Program.I().mod_ocgcore_decoration_card_selecting, 4, Vector3.zero, "card_selecting");
if ((card.p.position & (uint)CardPosition.Defence) > 0)
decoration.transform.GetChild(0).transform.localEulerAngles = new Vector3(0, 90, 0);
else
decoration.transform.GetChild(0).transform.localEulerAngles = new Vector3(0, 0, 0);
card.add_one_decoration(decoration, 4, Vector3.zero, "card_selecting"); card.add_one_decoration(decoration, 4, Vector3.zero, "card_selecting");
card.isShowed = true; card.isShowed = true;
card.currentFlash = gameCard.flashType.Select; card.currentFlash = gameCard.flashType.Select;
...@@ -5850,31 +5859,36 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5850,31 +5859,36 @@ public class Ocgcore : ServantWithCardDescription
break; break;
} }
bool allOnFieldOrHandButNotOverlay = true; bool allOnFieldButNotOverlay = true;
foreach (var card in cardsSelectable) foreach (var card in cardsSelectable)
{ {
if ((card.p.location & (uint)CardLocation.Hand) == 0 && (card.p.location & (uint)CardLocation.Onfield) == 0) if ((card.p.location & (uint)CardLocation.Onfield) == 0)
{ {
allOnFieldOrHandButNotOverlay = false; allOnFieldButNotOverlay = false;
break; break;
} }
if ((card.p.location & (uint)CardLocation.Overlay) > 0) if ((card.p.location & (uint)CardLocation.Overlay) > 0)
{ {
allOnFieldOrHandButNotOverlay = false; allOnFieldButNotOverlay = false;
break; break;
} }
} }
if (!allOnFieldOrHandButNotOverlay) if (!allOnFieldButNotOverlay)
Program.I().cardSelection.show(cardsSelectable, false, ES_min, ES_max, hint); Program.I().cardSelection.show(cardsSelectable, false, ES_min, ES_max, hint);
GameObject decoration = ABLoader.LoadAB("effects/other/fxp_arrow_aim_001"); GameObject decoration = ABLoader.LoadAB("effects/hitghlight/fxp_hl_select/fxp_hl_select_card_001");
var main = decoration.GetComponent<ParticleSystem>().main;
main.playOnAwake = true;
for (var i = 0; i < cardsSelectable.Count; i++) for (var i = 0; i < cardsSelectable.Count; i++)
{ {
//cardsSelectable[i].isShowed = true; //cardsSelectable[i].isShowed = true;
if (allOnFieldOrHandButNotOverlay) if ((cardsSelectable[i].p.location & (uint)CardLocation.Onfield) > 0 && (cardsSelectable[i].p.location & (uint)CardLocation.Overlay) == 0)
{ {
//cardsSelectable[i].add_one_decoration(Program.I().mod_ocgcore_decoration_card_selecting, 4, Vector3.zero, "card_selecting"); //cardsSelectable[i].add_one_decoration(Program.I().mod_ocgcore_decoration_card_selecting, 4, Vector3.zero, "card_selecting");
if ((cardsSelectable[i].p.position & (uint)CardPosition.Defence) > 0)
decoration.transform.GetChild(0).transform.localEulerAngles = new Vector3(0, 90, 0);
else
decoration.transform.GetChild(0).transform.localEulerAngles = new Vector3(0, 0, 0);
cardsSelectable[i].add_one_decoration(decoration, 4, Vector3.zero, "card_selecting"); cardsSelectable[i].add_one_decoration(decoration, 4, Vector3.zero, "card_selecting");
} }
cardsSelectable[i].currentFlash = gameCard.flashType.Select; cardsSelectable[i].currentFlash = gameCard.flashType.Select;
...@@ -5883,7 +5897,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5883,7 +5897,7 @@ public class Ocgcore : ServantWithCardDescription
for (var x = 0; x < cardsMustBeSelected.Count; x++) for (var x = 0; x < cardsMustBeSelected.Count; x++)
{ {
if (allOnFieldOrHandButNotOverlay) if (allOnFieldButNotOverlay)
{ {
Debug.Log("CardSomething2"); Debug.Log("CardSomething2");
if (currentMessage == GameMessage.SelectSum) if (currentMessage == GameMessage.SelectSum)
...@@ -5896,7 +5910,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -5896,7 +5910,7 @@ public class Ocgcore : ServantWithCardDescription
for (var x = 0; x < cardsSelected.Count; x++) for (var x = 0; x < cardsSelected.Count; x++)
{ {
if (allOnFieldOrHandButNotOverlay) if (allOnFieldButNotOverlay)
{ {
if (currentMessage == GameMessage.SelectSum) if (currentMessage == GameMessage.SelectSum)
cardsSelected[x].show_number(cardsSelected[x].levelForSelect_2); cardsSelected[x].show_number(cardsSelected[x].levelForSelect_2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment