_TheStrongestSnail/TheStrongestSnail/Assets/Scripts/otherWoniu.cs

54 lines
1.3 KiB
C#
Raw Normal View History

2024-11-18 16:53:39 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class otherWoniu : MonoBehaviour
{
2024-11-21 09:38:16 +08:00
2024-11-19 17:55:35 +08:00
public Transform OrPosTrams;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
public Transform Panrent;//<2F><><EFBFBD>׽ڵ<D7BD>
2024-11-21 12:03:01 +08:00
//public AllHouseContro allHouseContros;
2024-11-18 16:53:39 +08:00
// Start is called before the first frame update
void Start()
{
//OtherWoniuMove();
2024-11-21 12:03:01 +08:00
//allHouseContros=GameObject.Find("Canvas/Bg").GetComponent<AllHouseContro>();
2024-11-18 16:53:39 +08:00
}
2024-11-21 12:03:01 +08:00
public void OtherWoniuMove(HouseBtn house)
2024-11-18 16:53:39 +08:00
{
2024-11-21 12:03:01 +08:00
2024-11-21 09:38:16 +08:00
transform.GetComponent<OtherMove>().EndPos=house.post.transform;
transform.GetComponent<OtherMove>().StartMove();
2024-11-21 12:03:01 +08:00
2024-11-21 00:04:33 +08:00
2024-11-19 17:55:35 +08:00
}
public void BackWait()
{
// <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(Panrent);
Vector3 RePos = Panrent.position;
RePos = new Vector2(RePos.x + Random.Range(-300, 300), RePos.y + Random.Range(-80, 80));
transform.position = RePos;
transform.GetComponent<PlayerMovePos>().StartPos = OrPosTrams;
//transform.position =new Vector2 (Random.Range(-50,50), Random.Range(-50, 50));
2024-11-18 16:53:39 +08:00
}
}