예제 #1
0
    void Start()
    {
        controller = GetComponent <CharacterController> ();
        PlayerPrefs.SetString("savedLevel", Application.loadedLevelName);
        //	if (DisableTimeControl == false) {
        Vision = Instantiate(VisionPrefab, new Vector3(0.5f, 0.5f, 0.0f), Quaternion.identity) as GameObject;
        //Vision
        Vision.transform.SetParent(GameObject.Find("Main Camera").transform);


        Vision.GetComponent <SpriteRenderer> ().enabled = false;
        Transform[] children = Vision.GetComponentsInChildren <Transform> ();
        for (int i = 0; i < children.Length; ++i)
        {
            //if (transform.GetChild (i).childCount > 0){
            if (children [i].gameObject.GetComponent <SpriteRenderer> () != null)
            {
                children [i].gameObject.GetComponent <SpriteRenderer> ().enabled = false;
                //	 children[i].GameObject.GetComponent<SpriteRenderer>().enabled = false;
            }
        }
        //	}


        BlackBox = GameObject.FindGameObjectWithTag("BlackBox");
        BBScript = BlackBox.GetComponent <BlackBoxScript> ();

        audioer = GetComponent <AudioSource> ();
        controller.detectCollisions = false;

        j        = Time.time;
        Emoticon = gameObject.transform.FindChild("Emoticon").gameObject;
        Emoticon.GetComponent <SpriteRenderer> ().enabled = false;
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     BBoxScript    = GameObject.Find("GUI/BlackBox").GetComponent <BlackBoxScript> ();
     Camera        = GameObject.Find("Animations/Scene/Main Camera");
     ManagerScript = GameObject.Find("GameManager").GetComponent <GameManager> ();
     PlayerScript  = GameObject.Find("Player").GetComponent <PlayerController> ();
     MyAnimation   = GetComponent <Animator> ();
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        Player      = GameObject.Find("Player");
        PAnimator   = Player.GetComponent <PlayerAnimator> ();
        PController = Player.GetComponent <PlayerController> ();


        BBScript = Blackbox.GetComponent <BlackBoxScript> ();
    }
예제 #4
0
 void Start()
 {
     Player           = GameObject.Find("Player");
     ControllerScript = Player.GetComponent <PlayerController> ();
     HealthScript     = Player.GetComponent <playerHealth> ();
     //GetComponent<SpriteRenderer>().color = new Color (1f, 1f, 1f, 1.0f);
     //	StartTime = Time.time;
     BBox       = GameObject.FindGameObjectWithTag("BlackBox");
     BBoxScript = BBox.GetComponent <BlackBoxScript> ();
 }
예제 #5
0
    // Use this for initialization
    void Start()
    {
        Player           = GameObject.Find("Player");
        AnimatorScript   = Player.GetComponent <PlayerAnimator> ();
        ControllerScript = Player.GetComponent <PlayerController> ();
        HealthScript     = Player.GetComponent <playerHealth> ();



        BBox       = GameObject.FindGameObjectWithTag("BlackBox");
        BBoxScript = BBox.GetComponent <BlackBoxScript> ();
    }
예제 #6
0
    // Use this for initialization
    void Start()
    {
        Player           = GameObject.Find("Player");
        AnimatorScript   = Player.GetComponent <PlayerAnimator> ();
        ControllerScript = Player.GetComponent <PlayerController> ();
        HealthScript     = Player.GetComponent <playerHealth> ();
        ManagerScript    = GameObject.Find("GameManager").GetComponent <GameManager> ();


        BBox       = GameObject.FindGameObjectWithTag("BlackBox");
        BBoxScript = BBox.GetComponent <BlackBoxScript> ();


        if (CameraEventTrigger)
        {
            CameraSetTrigger = gameObject.transform.parent.gameObject;
            CameraScript     = CameraSetTrigger.GetComponent <CameraSetTrigger> ();
        }
        else if (TextEventTrigger)
        {
        }
    }
예제 #7
0
    // Use this for initialization
    void Start()
    {
        Application.runInBackground = true;


        Player          = GameObject.Find("Player");
        BBScript        = BlackBox.GetComponent <BlackBoxScript> ();
        PAnimator       = Player.GetComponent <PlayerAnimator> ();
        RealCutscene    = false;
        TimeControlTalk = false;
        if (Location == "Castle")
        {
            Scene = "Castle 1";
        }

        if (Location == "Field")
        {
            CutsceneEnabled             = true;
            PlayerController.canControl = false;

            //PlayerController.DisableTimeControl = true;
            CutsceneBlue = GameObject.Find("PlayerUI/CutsceneWhite");
            CutsceneBlue.GetComponent <GUITexture>().color = new Color(1f, 1f, 1f, 1f);
            Scene = "Field 1";

            PHealthScript = GameObject.Find("Player").GetComponent <playerHealth> ();
            PHealthScript.HideHearts();

            PlayerAnimator.PerformRegularAnimations = false;
            PAnimator.SittingInstance();


            //PController.ClearAllLists();
        }
        if (Location == "FieldCutscene")
        {
            RealCutscene  = true;
            CutsceneBlue  = GameObject.Find("PlayerUI/CutsceneWhite");
            Scene         = "FieldCutscene 1";
            PHealthScript = GameObject.Find("Player").GetComponent <playerHealth> ();
            PHealthScript.HideHearts();

            PlayerAnimator.PerformRegularAnimations = false;
            CutsceneEnabled             = true;
            PlayerController.canControl = false;
            CutsceneFadeOut("Black");
        }
        if (GameManager.Location == "FieldCutscene")
        {
            MyAnimation = GameObject.Find("Animations/Scene").GetComponent <Animator>();
        }
        if (GameManager.Location == "CaveCutscene")
        {
            PHealthScript = GameObject.Find("Player").GetComponent <playerHealth> ();
            PHealthScript.HideHearts();

            RealCutscene                = true;
            CutsceneEnabled             = true;
            PlayerController.canControl = false;
            MyAnimation  = GameObject.Find("Animations/Scene").GetComponent <Animator>();
            CutsceneBlue = GameObject.Find("PlayerUI/CutsceneWhite");
            //StartCoroutine(Tester());

            //Scene = "CaveCutscene 1";


            //	MyAnimation.Play ("CaveCutscene 1",0, 0.0f);

            Scene = "CaveCutscene 3";


            MyAnimation.Play("CaveCutscene 3", 0, 0.0f);


            //	MyAnimation.Play ("CaveCutscene 2",0, 0.0f);
            //	EventNumber = 6;
        }
    }