//GameObject otherName;
 void Awake()
 {
     cameraScript = GetComponent<ThirdPersonCameraNET>();
     controllerScript = GetComponent<ThirdPersonControllerNET>();
     targetScript = GetComponent<Targeting> ();
     playerScript = GetComponent<myCharacterScript> ();
 }
    //GameObject otherName;

    void Awake()
    {
        cameraScript     = GetComponent <ThirdPersonCameraNET>();
        controllerScript = GetComponent <ThirdPersonControllerNET>();
        targetScript     = GetComponent <Targeting> ();
        playerScript     = GetComponent <myCharacterScript> ();
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        //GameObject SpawnManager = GameObject.Find("Code");

        //move the code to the spawn manager's position
        //SpawnManager.transform.position = transform.position;
        //SpawnManager.transform.rotation = transform.rotation;

        //manager = SpawnManager.GetComponent<GameManagerVik>();

        if (builderObj = GameObject.FindGameObjectWithTag("Builder"))
        {
            builderObj.transform.position = BuilderSpawnPoint.transform.position;
            ThirdPersonCameraNET cam = builderObj.GetComponent <ThirdPersonCameraNET>();
            cam.LoadCameras();
        }

        if (moverObj = GameObject.FindGameObjectWithTag("Mover"))
        {
            moverObj.transform.position = MoverSpawnPoint.transform.position;
            ThirdPersonCameraNET cam = moverObj.GetComponent <ThirdPersonCameraNET>();
            cam.LoadCameras();

            moverObj.GetComponent <ThirdPersonControllerNET>().lastRespawn = moverObj.transform.position;
            Debug.Log("lastRespawn = " + moverObj.GetComponent <ThirdPersonControllerNET>().lastRespawn);

            if (Application.loadedLevel == 1)
            {
                moverObj.transform.Rotate(Vector3.up, 270);
            }
        }

        if (jumperObj = GameObject.FindGameObjectWithTag("Jumper"))
        {
            jumperObj.transform.position = JumperSpawnPoint.transform.position;
            ThirdPersonCameraNET cam = jumperObj.GetComponent <ThirdPersonCameraNET>();
            cam.LoadCameras();

            if (Application.loadedLevel == 1)
            {
                jumperObj.transform.Rotate(Vector3.up, 180);
            }
        }

        if (viewerObj = GameObject.FindGameObjectWithTag("Viewer"))
        {
            viewerObj.transform.position = ViewerSpawnPoint.transform.position;
            ThirdPersonCameraNET cam = viewerObj.GetComponent <ThirdPersonCameraNET>();
            cam.LoadCameras();

            if (Application.loadedLevel == 1)
            {
                viewerObj.transform.Rotate(Vector3.up, 90);
            }
        }
    }
Ejemplo n.º 4
0
    //SetFriendParty setScript;

    void Awake()
    {
        cameraScript     = GetComponent <ThirdPersonCameraNET>();
        controllerScript = GetComponent <ThirdPersonControllerNET>();
        healthScript     = GetComponentInChildren <Health>();
        scoreScript      = GetComponent <Highscore>();
        meleeScript      = GetComponentInChildren <Melee>();
        dmgScript        = GetComponent <Damage>();
        // setScript = GetComponent<SetFriendParty>();
    }
Ejemplo n.º 5
0
    //spawns on command, useful for getting people to spawn correctly midway through a game.
    public void SpawnTargetChar(string charname)
    {
        if (charname == "Builder")
        {
            if (GameObject.FindGameObjectWithTag("Builder"))
            {
                GameObject builder = GameObject.FindGameObjectWithTag("Builder");
                builder.transform.position = BuilderSpawnPoint.transform.position;
                ThirdPersonCameraNET cam = builder.GetComponent <ThirdPersonCameraNET>();
                cam.LoadCameras();
                return;
            }
        }

        if (charname == "Mover")
        {
            if (GameObject.FindGameObjectWithTag("Mover"))
            {
                GameObject mover = GameObject.FindGameObjectWithTag("Mover");

                mover.transform.position = MoverSpawnPoint.transform.position;
                ThirdPersonCameraNET cam = mover.GetComponent <ThirdPersonCameraNET>();
                cam.LoadCameras();
                return;
            }
        }

        if (charname == "Jumper")
        {
            if (GameObject.FindGameObjectWithTag("Jumper"))
            {
                GameObject jumper = GameObject.FindGameObjectWithTag("Jumper");

                jumper.transform.position = MoverSpawnPoint.transform.position;

                ThirdPersonCameraNET cam = jumper.GetComponent <ThirdPersonCameraNET>();
                cam.LoadCameras();
                return;
            }
        }

        if (charname == "Viewer")
        {
            if (GameObject.FindGameObjectWithTag("Viewer"))
            {
                //only the viewer needs a specialized setup - which MUST change every level. /Larry
                GameObject viewer = GameObject.FindGameObjectWithTag("Viewer");
                viewer.transform.position = ViewerSpawnPoint.transform.position;

                ThirdPersonCameraNET cam = viewer.GetComponent <ThirdPersonCameraNET>();
                cam.LoadCameras();
                return;
            }
        }
    }
Ejemplo n.º 6
0
    void Awake()
    {
        anim          = GetComponent <Animator>();
        guiHealthbar  = this.gameObject.transform.GetChild(3).GetChild(1).GetChild(0).gameObject;
        guiKills      = this.gameObject.transform.GetChild(3).GetChild(1).GetChild(1).gameObject;
        guiDeaths     = this.gameObject.transform.GetChild(3).GetChild(1).GetChild(2).gameObject;
        guiStaminaBar = this.gameObject.transform.GetChild(3).GetChild(2).GetChild(0).gameObject;

        cameraScript          = GetComponent <ThirdPersonCameraNET>();
        controllerScript      = GetComponent <ThirdPersonControllerNET>();
        characterController   = GetComponent <CharacterController>();
        mecanim_Control_Melee = GetComponent <Mecanim_Control_melee>();

        //New Scripts
        playerHealth = GetComponent <PlayerHealth>();
        blocking     = GetComponent <Blocking>();
    }
Ejemplo n.º 7
0
    private Quaternion correctPlayerRot = Quaternion.identity; //We lerp towards this

    #endregion Fields

    #region Methods

    void Awake()
    {
        cameraScript = GetComponent<ThirdPersonCameraNET>();
        controllerScript = GetComponent<ThirdPersonControllerNET>();
    }
Ejemplo n.º 8
0
 void Awake()
 {
     cameraScript     = GetComponent <ThirdPersonCameraNET>();
     controllerScript = GetComponent <ThirdPersonControllerNET>();
 }