Files
0B-FullautoLauncher/Scripts/ProjectileManager/PHGameObject.cs
2025-06-04 16:13:36 +09:30

37 lines
926 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace FullautoLauncher.Scripts.ProjectileManager
{
public class PHGameObject : ParameterHolderAbs, IDisposable
{
public Transform Transform { get; }
public PHGameObject(Transform transform, ProjectileParams par) : base(par)
{
Transform = transform;
}
public override void Fire()
{
Transform.gameObject.SetActive(true);
UpdatePosition();
}
public override void UpdatePosition()
{
Vector3 realPos = par.renderPosition - Origin.position;
Transform.position = realPos;
Transform.LookAt(realPos + par.moveDir);
}
public void Dispose()
{
GameObject.Destroy(Transform.gameObject);
}
}
}