コード例 #1
0
        void Start()
        {
            gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();

            horseGuy = GameObject.Find ("HorseMan");
            horseGuy.GetComponent<NPC_Interaction> ().missionDelegate = StartHorsesMission;// he will only give you the horse mission.

            overHereLight = horseGuy.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;
            overHereLight.SetActive (false);

            npc_Interact = horseGuy.GetComponent<NPC_Interaction> ();
            if (horseGuy.GetComponent<Animator> ()) {
                npc_Animator = horseGuy.GetComponent<Animator> ();
                if (!npc_Animator.isActiveAndEnabled) {
                    npc_Animator.enabled = true;
                }
            }
            horseDropOff = GameObject.Find ("HorseDropoff").GetComponent<MeshRenderer> ();
            horses = GameObject.Find ("Horses").transform;

            if (GetComponent<Animator> ()) {
                if (!npc_Animator.isActiveAndEnabled) {
                    npc_Animator.enabled = true;
                }
            }

            horse_X = 0;
            talkCoroutine = GameObject.Find ("NPC_TalkBox").GetComponent<Talk> ();
        }
コード例 #2
0
        //--------------------------------------------------------------------------------------------------------------≠//
        void Start()
        {
            gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();

            if (gameManager.gameState != GameState.NullState) {
                bridge_npc = GameObject.Find ("NPC_Bridge");
                priest = GameObject.Find ("Priest");
                lightHouseKeeper = GameObject.Find ("NPC_LightHouseKeeper");
                NPC_worker = GameObject.Find ("NPC_Worker");
                pickupTool = GameObject.Find ("Pickaxe");
                lighthouseRotate = GameObject.Find ("LigthHouse_Glass").GetComponent<LightOnRotate> ();
                LightHouseKeep_DropOff = GameObject.Find ("LightHouseKeep_DropOff");

                if (LightHouseKeep_DropOff.activeSelf) {
                    LightHouseKeep_DropOff.SetActive (false);
                }

                bridgeDrop = GameObject.Find ("Walkway-Bridge_C-Basic").GetComponent<DropTheBridge> ();
                overHereLight = bridge_npc.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;
                talkCoroutine = GameObject.Find ("NPC_TalkBox").GetComponent<Talk> ();

                if (lookAtObjects.Length != 4) {
                    lookAtObjects = new GameObject[4];
                }
                lookAtObjects [0] = GameObject.Find ("Church_Roof");
                lookAtObjects [1] = GameObject.Find ("Lighthouse_LookAt");
                lookAtObjects [2] = GameObject.Find ("Pickaxe");
                lookAtObjects [3] = GameObject.Find ("Walkway-Bridge_C-Basic");

                if (moveToObjects.Length != 3) {
                    moveToObjects = new Transform[3];
                }

                moveToObjects [0] = GameObject.Find ("lighthouseMove").transform;
                moveToObjects [1] = GameObject.Find ("Robbing_Point").transform;
                moveToObjects [2] = GameObject.Find ("Lighthouse_Move").transform;

                umbrella = GameObject.Find ("main_Sphere");

                npc_Interact = bridge_npc.GetComponent<NPC_Interaction> ();
                npc_Interact.missionDelegate = StartFinalMission;

                npc_Animator = bridge_npc.GetComponent<Animator> ();

                jumpAround_Final = true;
                currentPerson = bridge_npc;
                cmaera = GameObject.Find ("Follow Camera");
                cmaeraMove = cmaera.GetComponent<_MoveCamera> ();

                handle = GameObject.Find ("handle");

                workingSource = lighthouseRotate.transform.GetChild(1).GetComponent<AudioSource>();
            //				workingSFX = workingSource.clip;
            }
        }
コード例 #3
0
        void Update()
        {
            if (gameManager.missionState == MissionController.FinalMission) {

                bridge_npc.GetComponent<NavMeshMovement> ().FinalMission = true;
                if (currentPerson != null) {
                    overHereLight = currentPerson.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;
                    npc_Interact = currentPerson.GetComponent<NPC_Interaction> ();
                    npc_Interact.missionDelegate = StartFinalMission;

                    overHereLight.SetActive (jumpAround_Final);
                    if (currentPerson.GetComponent<Animator> ()) {
                        npc_Animator = currentPerson.GetComponent<Animator> ();
                    }
                }

                // Sets the mission in motion
                if (final_X == 0) {
                    bridge_npc.tag = "NPC_talk";
                } else {
                    bridge_npc.tag = "NPC";
                }

                if (pickupTool.transform.parent == handle.transform || pickupTool.transform.parent == lightHouseKeeper.transform.FindChild ("Hand_R").transform) {
                    toolPickedup = true;
                    jumpAround_Final = true;

                    if (final_X == 8) {
                        lightHouseKeeper.tag = "NPC_talk";
                    }

                    NPC_worker.transform.FindChild ("Hand_R").GetComponent<Animator> ().SetBool ("MIssing", true);
                    pickupTool.GetComponent<AudioSource> ().enabled = false;

                } else {
                    toolPickedup = false;
                }

                if (finalMission) {
                    Final_Mission ();
                }

                if (moveCmarea) {
                    CameraMove (lookAt, moveTo);
                }
            }
        }
コード例 #4
0
        void Start()
        {
            gameManager = GameObject.Find ("Follow Camera").GetComponent<GmaeManage> ();
            cmaera = GameObject.Find ("Follow Camera");

            NPC_dropoff = GameObject.Find ("NPC_Cat");
            npc_Animator = NPC_dropoff.GetComponent<Animator> ();
            overHereLight = NPC_dropoff.transform.FindChild ("Sphere").transform.FindChild ("Activate").gameObject;//where ever the light is on the NPC_Talk characters. I think it's a child of the 'head'.
            npc_Interact = NPC_dropoff.GetComponent<NPC_Interaction> ();
            catDropOff = GameObject.Find ("Drop-Off Zone (Cat)").GetComponent<MeshRenderer> ();

            cat_Activate = GameObject.Find("kitten").transform.FindChild("Activate").GetComponent<Light>();

            talkCoroutine = GameObject.Find ("NPC_TalkBox").GetComponent<Talk> ();
            jumpAround_Cat = true;
            catMission = true;
        }