94 lines
3.9 KiB
C#
94 lines
3.9 KiB
C#
|
using System;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine;
|
|||
|
|
|||
|
public class BoneCaptainController : EnemyController, IInteraction, IExplosionproof
|
|||
|
{
|
|||
|
private void OnEnable()
|
|||
|
{
|
|||
|
OnDeath += () =>
|
|||
|
{
|
|||
|
// <20>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
GameManager.Instance.PlayerManager.Enable = false;
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>
|
|||
|
GameManager.Instance.PlayerManager.LockEnable = true;
|
|||
|
// ˵<><CBB5>
|
|||
|
GameManager.Instance.UIManager.ShowDialog(GetComponent<ResourceController>().Name, new List<string> { "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD>", "<22><><EFBFBD><EFBFBD>ô<EFBFBD><C3B4><EFBFBD>䣿", "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⣬<EFBFBD><E2A3AC><EFBFBD>滹<EFBFBD><E6BBB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF><EFBFBD>Ķ<EFBFBD><C4B6>֣<EFBFBD><D6A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD>" }, () =>
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
EnvironmentController ec = null;
|
|||
|
GameManager.Instance.PoolManager.UseList.ForEach(obj =>
|
|||
|
{
|
|||
|
if (obj.GetComponent<MagicDoorController>() != null && (Vector2)obj.transform.position == new Vector2(0, -1)) ec = obj.GetComponent<EnvironmentController>();
|
|||
|
});
|
|||
|
ec.Open(null);
|
|||
|
// <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ
|
|||
|
Vector2 point = new Vector2();
|
|||
|
// <20><><EFBFBD>ɴ<EFBFBD>Ѫƿ
|
|||
|
for (int i = 0; i < 3; i++)
|
|||
|
{
|
|||
|
point.Set(-5 + i, 2);
|
|||
|
GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Item, 6).transform.position = point;
|
|||
|
}
|
|||
|
// <20><><EFBFBD>ɺ챦ʯ
|
|||
|
for (int i = 0; i < 3; i++)
|
|||
|
{
|
|||
|
point.Set(-5 + i, 3);
|
|||
|
GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Item, 7).transform.position = point;
|
|||
|
}
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʯ
|
|||
|
for (int i = 0; i < 3; i++)
|
|||
|
{
|
|||
|
point.Set(3 + i, 3);
|
|||
|
GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Item, 8).transform.position = point;
|
|||
|
}
|
|||
|
// <20><><EFBFBD>ɻ<EFBFBD>Կ<EFBFBD><D4BF>
|
|||
|
for (int i = 0; i < 3; i++)
|
|||
|
{
|
|||
|
point.Set(3 + i, 2);
|
|||
|
GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Item, 1).transform.position = point;
|
|||
|
}
|
|||
|
// <20><><EFBFBD><EFBFBD>¥<EFBFBD><C2A5>
|
|||
|
point.Set(0, -5);
|
|||
|
GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Environment, 7).transform.position = point;
|
|||
|
// <20><><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>ذ<EFBFBD>
|
|||
|
point.Set(0, -3);
|
|||
|
GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Environment, 14).transform.position = point;
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD>
|
|||
|
GameManager.Instance.PlayerManager.LockEnable = false;
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
GameManager.Instance.PlayerManager.Enable = true;
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
GameManager.Instance.SoundManager.LockEnable = false;
|
|||
|
// <20><>Ƶ<EFBFBD><C6B5><EFBFBD><EFBFBD>
|
|||
|
GameManager.Instance.SoundManager.PlaySound(ESoundType.Music, "LevelWin");
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|||
|
GameManager.Instance.PlotManager.PlotDictionary[4] = 5;
|
|||
|
});
|
|||
|
};
|
|||
|
}
|
|||
|
|
|||
|
public bool Interaction()
|
|||
|
{
|
|||
|
switch (GameManager.Instance.PlotManager.PlotDictionary[4])
|
|||
|
{
|
|||
|
// ״̬ 1 <20>Ի<EFBFBD>
|
|||
|
case 3:
|
|||
|
// <20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
|
|||
|
GameManager.Instance.UIManager.ShowDialog(GetComponent<ResourceController>().Name, new List<string> { "<22><>Ȼ<EFBFBD><C8BB><EFBFBD>ӳ<EFBFBD><D3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壿", "<22><><EFBFBD>Dz<EFBFBD><C7B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>ս<EFBFBD>ɣ<EFBFBD>" }, () =>
|
|||
|
{
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
GameManager.Instance.PlayerManager.Enable = true;
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>״̬
|
|||
|
GameManager.Instance.PlotManager.PlotDictionary[4] = 4;
|
|||
|
});
|
|||
|
break;
|
|||
|
case 4:
|
|||
|
return true;
|
|||
|
|
|||
|
}
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|