void HandleVisibility()
 {
     if (g.GetPlayer() != null)
     {
         HandleFadeOut(CheckShouldFadeIn());
     }
 }
Ejemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        Script_RunsManager t = (Script_RunsManager)target;

        if (GUILayout.Button("Exit via Last Elevator Increment"))
        {
            Script_Game game = Script_Game.Game;

            Model_Exit exitData = new Model_Exit(
                game.level,
                game.GetPlayer().transform.position,
                game.GetPlayer().FacingDirection
                );

            game.ElevatorCloseDoorsCutScene(
                null,
                null,
                Script_Elevator.Types.Last,
                exitData,
                Script_Exits.ExitType.SaveAndRestartOnLevel
                );
        }

        if (GUILayout.Button("IncrementRun()"))
        {
            t.IncrementRun();
        }

        if (GUILayout.Button("Print Cycle By Run Idx"))
        {
            Debug.Log($"mon {t.GetCycleByRunIds(0)}");
            Debug.Log($"tue {t.GetCycleByRunIds(1)}");
            Debug.Log($"wed {t.GetCycleByRunIds(2)}");
            Debug.Log($"thu {t.GetCycleByRunIds(3)}");
            Debug.Log($"fri {t.GetCycleByRunIds(4)}");
            Debug.Log($"sat {t.GetCycleByRunIds(5)}");
            Debug.Log($"sun {t.GetCycleByRunIds(6)}");
        }

        GUILayout.Space(12);

        if (GUILayout.Button("Handle Days Container Highlight"))
        {
            t.HandleDaysCanvas();
        }

        GUILayout.Space(12);

        if (GUILayout.Button("Weekday Start Setup"))
        {
            t.StartWeekdayCycle();
        }

        if (GUILayout.Button("Weekend Start Setup"))
        {
            t.StartWeekendCycle();
        }
    }
    void Awake()
    {
        npc    = GetComponent <Script_MovingNPC>();
        player = game.GetPlayer();

        origin = npc.transform.position;
    }
Ejemplo n.º 4
0
    private void HandleForceSyncAnimator(Script_Sticker sticker)
    {
        if (syncSticker.id == sticker.id)
        {
            AnimatorStateInfo animatorStateInfo = animator.GetCurrentAnimatorStateInfo(Script_PlayerMovement.Layer);

            game.GetPlayer().SyncAnimatorState(animatorStateInfo);
        }
    }
Ejemplo n.º 5
0
 // Run this on Fixed Update because player / triggers work on physics clock.
 void FixedUpdate()
 {
     if (game.GetPlayer().transform.position.z >= marker.Position.z)
     {
         game.IsHideHUD = true;
     }
     else
     {
         game.IsHideHUD = false;
     }
 }
    public void SetupPlayerReflection(Transform reflection)
    {
        player = game.GetPlayer();
        Script_PlayerReflection pr = reflection.GetComponent <Script_PlayerReflection>();

        pr.Setup(
            player,
            pr.axisObject == null ? pr.axis : pr.axisObject.position // TODO: remove once we don't have to use CreateReflection
            );
        // pr.transform.SetParent(game.playerContainer, false);
        player.SetPlayerReflection(pr);
    }
Ejemplo n.º 7
0
    private void MatchPlayerAnimator(Script_Sticker sticker)
    {
        int Layer = Script_PlayerMovement.Layer;

        RuntimeAnimatorController playerAnimatorController = game?.GetPlayer()?.MyAnimator.runtimeAnimatorController;

        if (playerAnimatorController == null)
        {
            return;
        }

        animator.runtimeAnimatorController = playerAnimatorController;

        AnimatorStateInfo animatorStateInfo = game.GetPlayer().MyAnimator
                                              .GetCurrentAnimatorStateInfo(Layer);

        animator.Play(animatorStateInfo.fullPathHash, Layer, animatorStateInfo.normalizedTime);
    }
 public void MatchPlayer()
 {
     transform.position = game.GetPlayer().FocalPoint.position;
 }