Skip to content

Instantly share code, notes, and snippets.

View ftvoid's full-sized avatar

ftvoid ftvoid

  • from the void
  • the earth
View GitHub Profile
using UnityEngine;
namespace DPV.Motion {
public class ChargeAndAccelerate : ChargeMotion {
[SerializeField]
private float acceleration = 0;
[SerializeField]
private float maxSpeed = 0;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
using UniRx.Triggers;
using DPV.Player;
using Core.Math;
namespace DPV.Motion {
/// <summary>
/// <summary>
/// ログ出力
/// </summary>
/// <param name="message">メッセージ</param>
public static void Log(object message) {
#if DEBUG
Instance.logger.Log(message);
#endif
}
/// <summary>
/// ログ出力
/// </summary>
/// <param name="message">メッセージ</param>
[Conditional("DEBUG")]
public static void Log(object message) {
Instance.logger.Log(message);
}
/// <summary>
/// <summary>
/// 弾丸発射
/// </summary>
protected override void OnBeginShoot() {
var vel = velocity;
var rotation = stageObject.Rotation;
// 発射速度の決定
switch ( direction ) {
case Direction.Fixed:
using UnityEngine;
using Core.Math;
using DPV.Player;
namespace DPV.Motion {
public class RotateToPlayer : MotionBase {
[SerializeField]
private float angleSpeed = 0;
protected override void OnUpdate() {
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
namespace DPV.Render {
[RequireComponent(typeof(SpriteRenderer))]
public class SpriteAnimation : MonoBehaviour {
[SerializeField]
using DPV.Player;
using DPV.Stage;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Core.Math;
namespace DPV.Shooter {
/// <summary>
/// 弾丸タイプのショット発射
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UniRx;
using UniRx.Triggers;
namespace DPV.Motion {
/// <summary>
/// カーブするモーション
/// </summary>
var rot = (cross > 0 ? angleSpeed : -angleSpeed) * Time.deltaTime;
velocity = Quaternion.Euler(0, 0, rot) * velocity;