Upload from upload_mods.ps1
This commit is contained in:
36
Scripts/ProjectileManager/PHGameObject.cs
Normal file
36
Scripts/ProjectileManager/PHGameObject.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user