示例#1
0
文件: BigHat.cs 项目: Nogous/Alice
    public void StartMiniGame()
    {
        Debug.LogError("WAT");
        //pathFollower.pathCreator =  ObjectSpawner.instance.GetPath();
        //pathFollower.distanceTravelled = ObjectSpawner.instance.gameObject.GetComponent<PathCreation.Examples.PathFollower>().distanceTravelled;

        playerPathFollower = PlayerEntity.instance.followers[0];
    }
示例#2
0
    public void InstantiateObject(string collectibleTag, float offsetX, float offsetY)
    {
        GameObject obj         = objectPooler.SpawnFromPool(collectibleTag, obstacleSpawnPoint.position, Vector3.zero);
        Vector3    newOffset   = new Vector3(Random.Range(-offsetX, offsetX), Random.Range(-offsetY, offsetY));
        Vector3    newRotation = new Vector3(Random.Range(-90, 90), Random.Range(-90, 90), Random.Range(-90, 90));

        obj.GetComponent <Obstacle>().SetChildOffset(newOffset);
        obj.GetComponent <Obstacle>().SetChildRotation(newRotation);
        obj.GetComponent <PathCreation.Examples.PathFollower>().pathCreator = MasterPath.instance.mainPath;
        PathCreation.Examples.PathFollower spawnParentFollower = obstacleSpawnPoint.parent.GetComponent <PathCreation.Examples.PathFollower>();
        obj.GetComponent <PathCreation.Examples.PathFollower>().distanceTravelled = spawnParentFollower.distanceTravelled + spawnParentFollower.pathOffset;
    }
示例#3
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.CompareTag("Player"))
     {
         GameManager.instance.teleporterInScene = this.gameObject;
         PathCreation.Examples.PathFollower playerFollower = other.transform.parent.GetComponent <PathCreation.Examples.PathFollower>();
         playerFollower.SetDistanceInPath(playerFollower.distanceTravelled - 2.5f, true);
         for (int i = 0; i < PlayerEntity.instance.followers.Count; i++)
         {
             PlayerEntity.instance.followers[i].SetDistanceInPath(PlayerEntity.instance.followers[i].GetComponent <PathCreation.Examples.PathFollower>().distanceTravelled - 2.5f, true);
         }
     }
 }
示例#4
0
    void Awake()
    {
        int iD = bossToSpawn.GetComponent <Boss>().ID;

        if (!Boss.defeateds.Contains(iD))
        {
            GameObject boss          = Instantiate(bossToSpawn, transform.position, Quaternion.identity);
            Boss       bossComponent = boss.GetComponent <Boss>();

            foreach (Sensor s in doors)
            {
                bossComponent.roomDoors.Add(s);
            }
            bossComponent.SetDoors();

            if (iD == 1 || iD == 2)//ridley
            {
                PathCreation.Examples.PathFollower ridleyPathFollower = boss.GetComponent <PathCreation.Examples.PathFollower>();
                ridleyPathFollower.pathCreator = ridleyPath;
            }
        }
    }
示例#5
0
文件: BigHat.cs 项目: Nogous/Alice
 private void Start()
 {
     playerPathFollower = PlayerEntity.instance.followers[0];
     StartMiniGame();
 }