Example #1
0
        public override void Trigger()
        {
            IMoveActionProperty moveActionProperty = m_Context.GetObject <IMoveActionProperty>();
            ChangeSpeedData     data = GetData <ChangeSpeedData>();

            moveActionProperty.SetSpeed(data.Speed * SceneController.SKILL_PRECISION);
        }
    public void UpdateEvent(float lifeRatio)
    {
        foreach (var pair in _eventsData)
        {
            if (lifeRatio < pair.Key)
            {
                switch (pair.Value.Key)
                {
                case BulletEventType.ChangeSpeed:
                    _getBulletSpeedAction = (callBack) =>
                    {
                        ChangeSpeedData speedData = pair.Value.Value as ChangeSpeedData;
                        if (callBack != null)
                        {
                            callBack((float)speedData.bulletSpeed);
                        }
                    };
                    break;

                case BulletEventType.ChangeTrajectory:
                    _getTrajectoryAction = (callBack) =>
                    {
                        ChangeTrajectoryData data = pair.Value.Value as ChangeTrajectoryData;
                        ITrajectory[]        temp = BulletTrajectoryDataUtil.GetStraightArray(data.trajectory[0]);
                        if (callBack != null)
                        {
                            callBack(temp);
                        }
                    };
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
    }