Added 3d pseduo canvas
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System.IO;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace InterfaceOff.WorldScene
|
||||
{
|
||||
@@ -8,13 +10,15 @@ namespace InterfaceOff.WorldScene
|
||||
{
|
||||
private static PlayerController Instance;
|
||||
private PlayerFrameInfo[] Frames;
|
||||
|
||||
|
||||
[SerializeField] private WindowSpawner ActiveWindowSpawner;
|
||||
[SerializeField] private LineRenderer BulletTracerRenderer;
|
||||
[SerializeField] private Transform BulletTracerStart;
|
||||
[SerializeField] private Transform BulletTracerEnd;
|
||||
[field: SerializeField] public int FrameIndex { get; private set; }
|
||||
[SerializeField] private int[] DeathIndices;
|
||||
[SerializeField] private ExternalCamera ExternalCamera;
|
||||
[SerializeField] private Image FrontLayerImage;
|
||||
|
||||
private const int MAX_WINDOWS = 20;
|
||||
|
||||
@@ -23,6 +27,8 @@ namespace InterfaceOff.WorldScene
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
/* Hides the cursor as a custom one is used */
|
||||
|
||||
/* Loads the JSON, temporary. TODO: Insert the JSON into this .cs file */
|
||||
string json = File.ReadAllText(Application.dataPath + "/Resources/playerframe.json");
|
||||
Frames = JsonUtility.FromJson<PlayerFrameInfoArray>(json).FrameInfo;
|
||||
@@ -66,5 +72,10 @@ namespace InterfaceOff.WorldScene
|
||||
BulletTracerRenderer.enabled = Frames[FrameIndex].ShootGun;
|
||||
}
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
FrontLayerImage.material.mainTexture = ExternalCamera.GetTexture();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user