You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.5 KiB
C#
53 lines
1.5 KiB
C#
using Entitas;
|
|
using UnityEngine;
|
|
using System.Collections.Generic;
|
|
using FluidDynamics;
|
|
|
|
public class MasterSoulShootInfo
|
|
{
|
|
public int Target;
|
|
public int Count;
|
|
public float TimeLeft;
|
|
}
|
|
|
|
[Game]
|
|
public class MasterSoulComponent : IComponent
|
|
{
|
|
public float ShakeTimeLeft;
|
|
public Fluid_Dynamics_Game_Emitter Emitter;
|
|
public float ShootTimeLeft;
|
|
public Queue<int> ShootTargetQueue = new Queue<int>();
|
|
public List<MasterSoulShootInfo> ShootPreList = new List<MasterSoulShootInfo>();
|
|
}
|
|
|
|
namespace Game
|
|
{
|
|
public abstract partial class Util
|
|
{
|
|
public static void ClearMasterSoul(GameEntity entity)
|
|
{
|
|
var masterSoul = entity.masterSoul;
|
|
masterSoul.ShakeTimeLeft = 0;
|
|
masterSoul.ShootTimeLeft = 0;
|
|
masterSoul.ShootTargetQueue.Clear();
|
|
}
|
|
|
|
public static void SetMasterSoulDir(GameEntity entity, Vector2 dir)
|
|
{
|
|
var masterSoul = entity.masterSoul;
|
|
masterSoul.Emitter.SetParticleDir(dir);
|
|
}
|
|
|
|
public static void AddMasterSoulShootTarget(GameEntity entity, int target, int count)
|
|
{
|
|
var masterSoul = entity.masterSoul;
|
|
var newInfo = new MasterSoulShootInfo
|
|
{
|
|
Target = target,
|
|
Count = count,
|
|
TimeLeft = GameConst.MasterSoulShootPreTime,
|
|
};
|
|
masterSoul.ShootPreList.Add(newInfo);
|
|
}
|
|
}
|
|
} |