Commit 051057d7 authored by SherryChaos's avatar SherryChaos

animation for [Sky Striker Mobilize - Engage!]

parent 1affd81b
......@@ -7251,7 +7251,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99988, y: 0}
m_AnchoredPosition: {x: -399.99976, y: 0}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &129642814
......@@ -8176,7 +8176,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: -490.00037, y: 0}
m_AnchoredPosition: {x: -490.00024, y: 0}
m_SizeDelta: {x: 490, y: 2000}
m_Pivot: {x: 0, y: 0.5}
--- !u!114 &153416284
......@@ -10585,7 +10585,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &203992981
......@@ -12569,7 +12569,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1687306876}
m_Direction: 2
m_Value: 1
m_Size: 0.99999994
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -13635,7 +13635,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &250597853
......@@ -16879,7 +16879,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &296823158
......@@ -19237,7 +19237,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99988, y: 300}
m_AnchoredPosition: {x: -399.99976, y: 300}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &365844423
......@@ -20408,7 +20408,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 931169953}
m_HandleRect: {fileID: 931169952}
m_Direction: 2
m_Value: 0
m_Value: 1
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
......@@ -37505,7 +37505,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &681567863
......@@ -40276,7 +40276,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: -419.99988, y: -60}
m_AnchoredPosition: {x: -419.99976, y: -60}
m_SizeDelta: {x: 400, y: 760}
m_Pivot: {x: 0, y: 1}
--- !u!114 &736958434
......@@ -41825,7 +41825,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 476827028}
m_Direction: 2
m_Value: 1
m_Size: 0.62319434
m_Size: 0.62778115
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -43954,7 +43954,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0.000061035156}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 840}
m_Pivot: {x: 0, y: 1}
--- !u!1 &824349623
......@@ -51475,7 +51475,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1163139165}
m_Direction: 2
m_Value: 1
m_Size: 0.99999994
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -54287,7 +54287,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 399.99988, y: -132}
m_AnchoredPosition: {x: 399.99976, y: -132}
m_SizeDelta: {x: 330, y: 840}
m_Pivot: {x: 1, y: 1}
--- !u!114 &998933908
......@@ -54748,7 +54748,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1005556390
......@@ -55482,7 +55482,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 948258731}
m_Direction: 2
m_Value: 0
m_Size: 0.99999994
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -73356,7 +73356,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1371617110
......@@ -73508,7 +73508,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99988, y: 150}
m_AnchoredPosition: {x: -399.99976, y: 150}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1374530642
......@@ -75258,7 +75258,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1714379351}
m_Direction: 2
m_Value: 1
m_Size: 0.99999994
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -76824,7 +76824,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 761159129}
m_HandleRect: {fileID: 761159127}
m_Direction: 2
m_Value: 0
m_Value: 1
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
......@@ -82253,6 +82253,7 @@ MonoBehaviour:
ES_level: 0
ES_overFlow: 0
duelEnded: 0
nextMoveManager: {fileID: 0}
chainSolving: 0
ignoreNextMoveLog: 0
needRefreshHand0: 1
......@@ -93036,7 +93037,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 677938099}
m_Direction: 2
m_Value: 1
m_Size: 0.99999994
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
......@@ -98940,7 +98941,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: -399.99988, y: -150}
m_AnchoredPosition: {x: -399.99976, y: -150}
m_SizeDelta: {x: -1350, y: 80}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1800729521
......@@ -104095,7 +104096,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 247.49988, y: -540}
m_AnchoredPosition: {x: 247.49976, y: -540}
m_SizeDelta: {x: -565, y: 1080}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1895460095
......@@ -884,7 +884,7 @@ namespace MDPro3
public GPS cacheP;
bool inAnimation;
static uint lastMovedLocation;
public float Move(GPS gps, bool rush = false, float wait = 0f)
public float Move(GPS gps, bool rush = false, float wait = 0f, float overrideMoveTime = 0)
{
Program.I().ocgcore.lastMoveCard = this;
......@@ -960,6 +960,14 @@ namespace MDPro3
ModelAt(cacheP);
}
if(Program.I().ocgcore.nextMoveAction != null)
{
OcgCore.messagePass = false;
Program.I().ocgcore.nextMoveAction.Invoke();
model.SetActive(false);
return 0;
}
inAnimation = true;
Program.I().ocgcore.needRefreshHand0 = true;
Program.I().ocgcore.needRefreshHand1 = true;
......@@ -1165,44 +1173,52 @@ namespace MDPro3
bool handAppeal = false;
bool fieldAppeal = false;
var ease = Ease.Unset;
switch (Program.I().ocgcore.currentMessage)
if(overrideMoveTime > 0f)
{
case GameMessage.Draw:
if (p.controller == 0)
{
moveTime = 0.6f;
handAppeal = true;
}
else
moveTime = overrideMoveTime;
}
else
{
switch (Program.I().ocgcore.currentMessage)
{
case GameMessage.Draw:
if (p.controller == 0)
{
moveTime = 0.6f;
handAppeal = true;
}
else
moveTime = 0.2f;
break;
case GameMessage.Move:
if ((p.location & (uint)CardLocation.Onfield) > 0
&& cacheP != null
&& (cacheP.location & (uint)CardLocation.Onfield) == 0
&& (p.location & (uint)CardLocation.Overlay) == 0)
{
moveTime = 0.4f;
fieldAppeal = true;
}
else if ((p.location & (uint)CardLocation.Hand) > 0
&& p.controller == 0)
{
moveTime = 0.6f;
handAppeal = true;
}
else
moveTime = 0.25f;
break;
case GameMessage.FlipSummoning:
case GameMessage.PosChange:
moveTime = 0.1f;
break;
case GameMessage.ShuffleSetCard:
case GameMessage.Swap:
moveTime = 0.2f;
break;
case GameMessage.Move:
if ((p.location & (uint)CardLocation.Onfield) > 0
&& cacheP != null
&& (cacheP.location & (uint)CardLocation.Onfield) == 0
&& (p.location & (uint)CardLocation.Overlay) == 0)
{
moveTime = 0.4f;
fieldAppeal = true;
}
else if ((p.location & (uint)CardLocation.Hand) > 0
&& p.controller == 0)
{
moveTime = 0.6f;
handAppeal = true;
}
else
moveTime = 0.25f;
break;
case GameMessage.FlipSummoning:
case GameMessage.PosChange:
moveTime = 0.1f;
break;
case GameMessage.ShuffleSetCard:
case GameMessage.Swap:
moveTime = 0.2f;
break;
break;
}
}
var cardPlane = manager.GetElement<Transform>("CardPlane");
var pivot = manager.GetElement<Transform>("Pivot");
var offset = manager.GetElement<Transform>("Offset");
......@@ -1231,6 +1247,8 @@ namespace MDPro3
|| (p.location & (uint)CardLocation.MonsterZone) == 0)
HideLabel();
}));
sequence.Join(model.transform.DOLocalRotate(Vector3.zero, targetMainMoveTime));
if(fieldAppeal)
{
sequence.Join(cardPlane.DOLocalMove(Vector3.up * 15f, targetMainMoveTime).SetEase(ease).OnComplete(() =>
......@@ -1473,6 +1491,18 @@ namespace MDPro3
manager.GetElement<Transform>("Turn").localPosition = Vector3.zero;
}
public void ResetModelRotation()
{
if (model == null)
return;
manager.transform.localEulerAngles = Vector3.zero;
manager.GetElement<Transform>("CardPlane").localEulerAngles = Vector3.zero;
manager.GetElement<Transform>("Pivot").localEulerAngles = Vector3.zero;
manager.GetElement<Transform>("Offset").localEulerAngles = Vector3.zero;
manager.GetElement<Transform>("Turn").localEulerAngles = Vector3.zero;
manager.GetElement<Transform>("CardModel").localEulerAngles = Vector3.zero;
}
#region Animation
public static float handAngle = -10f;
......
......@@ -385,6 +385,18 @@ namespace MDPro3
yield return null;
rawImage.texture = ie.Current;
}
public IEnumerator LoadCardTohRendererAsync(Renderer renderer, int code, bool cache = false)
{
var ie = LoadCardAsync(code, cache);
StartCoroutine(ie);
while (ie.MoveNext())
yield return null;
var mat = GetCardMaterial(code, cache);
mat.mainTexture = ie.Current;
renderer.material = mat;
}
public static void ClearCache()
{
foreach (var card in cachedCards.Values)
......
......@@ -772,6 +772,7 @@ namespace MDPro3
card.Dispose();
cards.Clear();
pause = false;
nextMoveAction = null;
GC.Collect();
yield return null;
CameraManager.ShiftTo2D();
......@@ -838,8 +839,6 @@ namespace MDPro3
//ABLoader.LoadFromFolder("5c2f34a0");//assets/resourcesassetbundle/duel/timeline/duel/universal/attack/attackredeyes/attackredebless.prefab
//ABLoader.LoadFromFolder("fbf001db");//assets/resourcesassetbundle/duel/timeline/duel/universal/attack/attackredeyes/attackrededummycardset.prefab
ABLoader.LoadFromFolder("MasterDuel/Card/63166095");
#region Attack Line
if (attackLine == null)
{
......@@ -1408,6 +1407,8 @@ namespace MDPro3
bool needDamageResponseInstant;
public Action endingAction;
public Action nextMoveAction;
public ElementObjectManager nextMoveManager;
public float nextMoveTime = 0f;
public void CoreReset()
{
......@@ -1477,7 +1478,7 @@ namespace MDPro3
Program.I().room.duelEnded = false;
Program.I().room.joinWithReconnect = false;
endingAction = null;
nextMoveAction = null;
log.ClearLog();
log.showing = true;
OnLog(true);
......@@ -3610,7 +3611,23 @@ namespace MDPro3
}
else if(code == 63166095)//ENGAGE
{
Destroy(effect);
messagePass = true;
nextMoveAction = () =>
{
var effect = ABLoader.LoadFromFolder("MasterDuel/Card/63166095", "CardEffect63166095", true);
allGameObjects.Add(effect);
var manager = effect.transform.GetChild(0).GetComponent<ElementObjectManager>();
nextMoveManager = manager;
nextMoveTime = 0.3f;
var mono = manager.gameObject.AddComponent<DoWhenPlayableDirectorStop>();
mono.action = () =>
{
Destroy(effect);
};
var cardFace = manager.GetElement<Renderer>("SummonPosDummy");
StartCoroutine(Program.I().texture_.LoadCardTohRendererAsync(cardFace, lastMoveCard.GetData().Id, true));
};
}
}
else
......
......@@ -77,6 +77,21 @@ namespace YgomSystem.Timeline
if (MonsterCutin.HasCutin(code))
MonsterCutin.Play(code, (int)Program.I().ocgcore.summonCard.p.controller);
}
else if(label == "Next")//Engage
{
var target = Program.I().ocgcore.nextMoveManager.GetElement<Transform>("DummyCard01");
var card = Program.I().ocgcore.lastMoveCard;
card.model.SetActive(true);
card.ResetModelRotation();
card.model.transform.position = target.position;
card.model.transform.eulerAngles = new Vector3(- target.eulerAngles.x, 0f, 0f);
Program.I().ocgcore.nextMoveAction = null;
card.Move(card.p, false, 0f, Program.I().ocgcore.nextMoveTime);
DOTween.To(v => { }, 0, 0, Program.I().ocgcore.nextMoveTime).OnComplete(() =>
{
OcgCore.messagePass = true;
});
}
}
}
......
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