Example #1
0
    public void Init()
    {
        groundGenerator.SetGroundRootTransform(transform);
        groundGenerator.Init();
        groundGenerator.SetUpdateNavMeshAction(() => this.UpdateNavMesh());

        GameObject         startPlatform      = CreateStartPlatform();
        PlatformController platformController = startPlatform.GetComponent <PlatformController>();

        if (EntityManager.GetPlayer() != null)
        {
            platformController.AddDestinationReachedListener(() => {
                EntityManager.GetPlayer().transform.position = startPlatform.transform.position + new Vector3(0, 3, 0);
                groundGenerator.SpawnGroup(startPlatform.transform.position);
            });
        }
    }