예제 #1
0
    private void OnEnable()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(this.gameObject);
        }

        gamePlane = GameObject.Find("Gameplay Plane");

        planeComp    = gamePlane.GetComponentInChildren <PlaneMovement>();
        movementComp = gamePlane.GetComponentInChildren <PlayerMovement>();
        deathComp    = gamePlane.GetComponentInChildren <PlayerDeath>();
        obstacleComp = gamePlane.GetComponentInChildren <ObstaclePlacementState>();
        followComp   = gamePlane.GetComponentInChildren <PlayerFollowTarget>();

        progressObstacle = Resources.Load <GameObject>("ProgressionObstacle");
        endObstacle      = Resources.Load <GameObject>("CompletionObstacle");

        whiteFade      = GameObject.Find("WhiteFade");
        whiteFadeColor = whiteFade.GetComponentInChildren <Image>().color;

        whiteFadeColor.a = 0f;
    }
예제 #2
0
 private void OnEnable()
 {
     movementComp    = GetComponentInChildren <PlayerMovement>();
     followComp      = GetComponentInChildren <PlayerFollowTarget>();
     speedMultiplier = 0.5f;
 }