备份CatanBuilding瘦身独立工程
This commit is contained in:
29
Assets/Scripts/UI/Potion/Action/PotionAction.cs
Normal file
29
Assets/Scripts/UI/Potion/Action/PotionAction.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class PotionAction
|
||||
{
|
||||
protected float m_WaitTime;
|
||||
public void SetWaitTime(float time)
|
||||
{
|
||||
m_WaitTime = time;
|
||||
}
|
||||
#region 生命周期
|
||||
public virtual void Update(float deltaTime)
|
||||
{
|
||||
m_WaitTime -= deltaTime;
|
||||
}
|
||||
public virtual bool IsValid()
|
||||
{
|
||||
return m_WaitTime > 0f;
|
||||
}
|
||||
public virtual void Action()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/Potion/Action/PotionAction.cs.meta
Normal file
11
Assets/Scripts/UI/Potion/Action/PotionAction.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1ee0091058c15c408b238b9e5b285df
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
32
Assets/Scripts/UI/Potion/Action/PotionDelay1Action.cs
Normal file
32
Assets/Scripts/UI/Potion/Action/PotionDelay1Action.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using NSubstitute;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class PotionDelay1Action : PotionAction
|
||||
{
|
||||
int m_Type = 0;
|
||||
PotionGridUI m_PotionGridUI;
|
||||
Action<int, PotionGridUI> m_Callback;
|
||||
|
||||
public void SetData(int type, PotionGridUI gridUI, Action<int, PotionGridUI> callback)
|
||||
{
|
||||
m_Type = type;
|
||||
m_PotionGridUI = gridUI;
|
||||
m_Callback = callback;
|
||||
}
|
||||
#region 生命周期
|
||||
public override void Action()
|
||||
{
|
||||
base.Action();
|
||||
if (m_Callback != null)
|
||||
{
|
||||
m_Callback.Invoke(m_Type, m_PotionGridUI);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/Potion/Action/PotionDelay1Action.cs.meta
Normal file
11
Assets/Scripts/UI/Potion/Action/PotionDelay1Action.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5fedf046332e44e46b6024fd9f63f8ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
36
Assets/Scripts/UI/Potion/Action/PotionDelayAction.cs
Normal file
36
Assets/Scripts/UI/Potion/Action/PotionDelayAction.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class PotionDelayAction : PotionAction
|
||||
{
|
||||
int m_Type = 0;
|
||||
PotionGridUI m_TargetGridUI;
|
||||
PotionGridUI m_SrcGridUI;
|
||||
PotionGridUI m_TemporaryGridUI;
|
||||
public Func<int, PotionGridUI, PotionGridUI, PotionGridUI, int> m_Callback = null;
|
||||
|
||||
public void SetData(int type, PotionGridUI src, PotionGridUI target, PotionGridUI temporary, Func<int, PotionGridUI, PotionGridUI, PotionGridUI, int> callback)
|
||||
{
|
||||
m_Type = type;
|
||||
m_SrcGridUI = src;
|
||||
m_TargetGridUI = target;
|
||||
m_TemporaryGridUI = temporary;
|
||||
m_Callback = callback;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
public override void Action()
|
||||
{
|
||||
base.Action();
|
||||
if (m_Callback != null)
|
||||
{
|
||||
m_Callback.Invoke(m_Type, m_SrcGridUI, m_TargetGridUI, m_TemporaryGridUI);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UI/Potion/Action/PotionDelayAction.cs.meta
Normal file
11
Assets/Scripts/UI/Potion/Action/PotionDelayAction.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 84eee872742bca94990c711790d84e39
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user