_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/Battle_Royale/BossContro.cs

87 lines
2.4 KiB
C#
Raw Normal View History

2024-11-13 02:03:11 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BossContro : MonoBehaviour
{
public Transform Parent;
public Transform originalParent;
public Transform BoosStartPos;
public static BossContro instance;
public Transform StartPos;
2024-11-13 18:01:18 +08:00
public Animator BossAni;//boos<6F><73><EFBFBD><EFBFBD>
public bool IsLeft;
2024-11-13 21:45:48 +08:00
public int HouseId;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2024-11-14 18:11:08 +08:00
public Transform BoosHouse;//boos<6F><73><EFBFBD><EFBFBD>
2024-11-15 12:09:52 +08:00
public AllHouseContro allHouseContro;
2024-11-13 02:03:11 +08:00
// Start is called before the first frame update
void Start()
{
instance = this;
originalParent = transform.parent;
}
public void MoveParent()
{
// <20><>¼ԭʼ<D4AD>ĸ<EFBFBD><C4B8><EFBFBD><EFBFBD><EFBFBD>
// <20><> childObject <20><>Ϊ<EFBFBD>µ<EFBFBD> parentObject <20><><EFBFBD>ӽڵ㣬<DAB5><E3A3AC><EFBFBD>ŵ<EFBFBD><C5B5><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>λ<EFBFBD><CEBB>
transform.SetParent(Parent);
transform.SetAsLastSibling();
}
public void ReturnParent()
{
// <20><>Ҫʱ<D2AA><CAB1> childObject <20>ƻ<EFBFBD>ԭʼ<D4AD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD><D2BB><EFBFBD>ӽڵ<D3BD>
transform.SetParent(originalParent);
transform.SetAsFirstSibling(); // <20><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>һ<EFBFBD><D2BB><EFBFBD>ӽڵ<D3BD>
2024-11-13 18:01:18 +08:00
2024-11-13 02:03:11 +08:00
transform.position= StartPos.position;
BoosStartPos=StartPos;
2024-11-14 18:11:08 +08:00
Tools.MoveUpOrDwon(transform.parent.GetComponent<HouseBtn>().door, -270);//<2F><><EFBFBD><EFBFBD>
2024-11-13 02:03:11 +08:00
}
2024-11-14 18:11:08 +08:00
2024-11-13 02:03:11 +08:00
public void BossMove()
{
int Index=Random.Range(0,5);
switch (Index)
{
case 0:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos1;
break;
case 1:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos2;
break;
case 2:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos3;
break;
case 3:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos4;
break;
case 4:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos5;
break;
case 5:
GetComponent<PlayerMove>().EndPos = GetComponent<PlayerMove>().TypeEndPos6;
break;
}
//MoveParent();
2024-11-15 12:09:52 +08:00
BossAni.SetInteger("State", 1); // <20><><EFBFBD><EFBFBD>תΪ<D7AA>ƶ<EFBFBD>
2024-11-14 18:11:08 +08:00
GetComponent<PlayerMove>().StartMove(); // <20><>ʼ<EFBFBD>ƶ<EFBFBD>
2024-11-15 12:09:52 +08:00
//Tools.MoveUpOrDwon(transform.parent.GetComponent<HouseBtn>().door, 270, () => {
//});
2024-11-13 02:03:11 +08:00
}
}