小精灵

This commit is contained in:
wulongxiao 2025-01-06 16:49:54 +08:00
parent 8e2f1178a1
commit 0b8c78b935
4 changed files with 12 additions and 4 deletions

View File

@ -137,7 +137,12 @@ public class BaoshiRoomcontroller : MonoBehaviour
musk.gameObject.SetActive(false);
fishMan = GameObject.Instantiate(fishManPrefab, this.transform);
fishManlist.Add(fishMan);
fishMan.transform.position = endPos.position;
Vector3 pos = new Vector3(Random.Range((endPos.position.x - startPos.position.x) / 2, endPos.position.x), endPos.position.y, endPos.position.z);
fishMan.transform.position = pos;
fishManShipContorl = fishMan.GetComponent<minerControl>();
fishManShipContorl.init(this.paths, this.pathsNeedTimer, this.fishingNeedTimer, this.restTimer, this.startPos, this.endPos);

View File

@ -75,7 +75,7 @@ public class Scene_baoshikuang : MonoBehaviour
go.ShipNumber = info.activate_count;
index++;
}
}
}
}

View File

@ -62,7 +62,7 @@ public class minerControl : MonoBehaviour
public void init(List<Path> path,float pathsNeedTimer,float fishingNeedTimer,float restTimer,Transform startPos,Transform endPos)
{
this.paths = path;
this.pathsNeedTimer = pathsNeedTimer;
this.pathsNeedTimer = pathsNeedTimer+Random.Range(0,10);
this.fishingNeedTimer = fishingNeedTimer;
this.restTimer = restTimer;
this.startPos = startPos;

View File

@ -129,7 +129,10 @@ public class roomcontroller : MonoBehaviour
musk.gameObject.SetActive(false);
fishMan = GameObject.Instantiate(fishManPrefab, this.transform);
fishManlist.Add(fishMan);
fishMan.transform.position = endPos.position;
Vector3 pos = new Vector3(Random.Range((endPos.position.x-startPos.position.x)/2, endPos.position.x), endPos.position.y, endPos.position.z);
fishMan.transform.position = pos;
fishManShipContorl = fishMan.GetComponent<minerControl>();
fishManShipContorl.init(this.paths, this.pathsNeedTimer, this.fishingNeedTimer, this.restTimer, this.startPos, this.endPos);