备份CatanBuilding瘦身独立工程
This commit is contained in:
65
Assets/Scripts/EventWashing/Assistants/SplashAnimation.cs
Normal file
65
Assets/Scripts/EventWashing/Assistants/SplashAnimation.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using asap.core.common;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class SplashAnimation : MonoBehaviour, IPoolableObject
|
||||
{
|
||||
private IObjectPool pool;
|
||||
private float m_Timer;
|
||||
private bool m_IsTiming = false;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (m_IsTiming == false) return;
|
||||
m_Timer -= Time.deltaTime;
|
||||
if (m_Timer <= 0)
|
||||
{
|
||||
ReturnPool();
|
||||
m_Timer = 0f;
|
||||
m_IsTiming = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetTimer(float timer)
|
||||
{
|
||||
m_Timer = timer;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
m_IsTiming = true;
|
||||
}
|
||||
private void OnDisable()
|
||||
{
|
||||
m_IsTiming = false;
|
||||
}
|
||||
|
||||
public void OnDespawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void OnPoolCreate(IObjectPool objectPool)
|
||||
{
|
||||
pool = objectPool;
|
||||
}
|
||||
|
||||
public void OnPoolDestroy()
|
||||
{
|
||||
pool = null;
|
||||
}
|
||||
|
||||
public void OnSpawn()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void ReturnPool()
|
||||
{
|
||||
pool?.DespawnObject(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd67af5831fd5df46b00edd8bba1489c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
51
Assets/Scripts/EventWashing/Assistants/SprayAnimation.cs
Normal file
51
Assets/Scripts/EventWashing/Assistants/SprayAnimation.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class SprayAnimation : MonoBehaviour
|
||||
{
|
||||
[Tooltip("粒子特效")]
|
||||
[SerializeField]
|
||||
private ParticleSystem[] m_ParticleSystems = null;
|
||||
|
||||
#region 特效功能相关
|
||||
public void PlayEffect()
|
||||
{
|
||||
if (m_ParticleSystems != null)
|
||||
{
|
||||
int count = m_ParticleSystems.Length;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
m_ParticleSystems[i].gameObject.SetActive(true);
|
||||
m_ParticleSystems[i].Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
public void StopEffect()
|
||||
{
|
||||
if (m_ParticleSystems != null)
|
||||
{
|
||||
int count = m_ParticleSystems.Length;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
m_ParticleSystems[i].Stop();
|
||||
m_ParticleSystems[i].gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void DisableEffect()
|
||||
{
|
||||
if (m_ParticleSystems != null)
|
||||
{
|
||||
int count = m_ParticleSystems.Length;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
m_ParticleSystems[i].gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a25e27952b497654dbb4f7729bb43ede
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
15
Assets/Scripts/EventWashing/Assistants/UpdateOperationSet.cs
Normal file
15
Assets/Scripts/EventWashing/Assistants/UpdateOperationSet.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace game
|
||||
{
|
||||
public class UpdateOperationSet
|
||||
{
|
||||
public UnityAction<float> Update = null; // 更新事件
|
||||
public Func<bool> IsUpdateOver = null;
|
||||
public Func<int, bool> Callback = null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c0166e80b4367d4aae2c34c83942c7b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user