71 lines
1.9 KiB
C#
71 lines
1.9 KiB
C#
using System;
|
|
using DragonLi.Core;
|
|
using Mirror;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class EnergyPump : NetworkBehaviour
|
|
{
|
|
public SphereCollider sphere;
|
|
|
|
public int energyPumpTag;
|
|
|
|
public GameObject txt;
|
|
|
|
|
|
public void ColliderEnergyPump()
|
|
{
|
|
GameManager.Ins.EnergyPumpFillAmount += 0.2f;
|
|
EventDispatcher.TriggerEvent("ChangeEnergyPumpUI", GameManager.Ins.EnergyPumpFillAmount);
|
|
sphere.enabled = false;
|
|
transform.gameObject.SetActive(false);
|
|
NetworkServer.Destroy(transform.gameObject);
|
|
}
|
|
|
|
public void ShowLandMask()
|
|
{
|
|
switch (energyPumpTag)
|
|
{
|
|
case 1:
|
|
GameManager.Ins?.ShowLandmark(2, 3);
|
|
GameManager.Ins.HudMessage(1);
|
|
break;
|
|
case 2:
|
|
|
|
GameManager.Ins.HudMessage(2);
|
|
GameManager.Ins?.ShowLandmark(4, 5);
|
|
break;
|
|
case 3:
|
|
GameManager.Ins.ShowLandmark(7, 8);
|
|
GameObject rockfall = GameManager.Ins.GenerateRockfall(new Vector3(6f, 22.3f, 3.26f), new Vector3(-90, 0, 0));
|
|
CoroutineTaskManager.Instance.WaitSecondTodo(() =>
|
|
{
|
|
NetworkServer.Destroy(rockfall);
|
|
}, 5.0f);
|
|
GameManager.Ins.HudMessage(4);
|
|
|
|
break;
|
|
case 4:
|
|
GameManager.Ins.ShowLandmark(9, 10);
|
|
GameManager.Ins.HudMessage(5);
|
|
break;
|
|
case 5:
|
|
GameManager.Ins.ShowLandmark(11, 12);
|
|
GameManager.Ins.HudMessage(6);
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
public void Init(int energyPumpTag)
|
|
{
|
|
this.energyPumpTag = energyPumpTag;
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
txt.transform.parent.GetComponent<Transform>().LookAt(GameInit.Ins.MRCamera.transform);
|
|
}
|
|
}
|