private void Awake()
 {
     crosshairManager = GetComponentInChildren <CrosshairManager>();
     changeWeapon     = GetComponent <ChangeWeapon>();
     bulletManager    = bullet.GetComponent <BulletManager>();
     weaponSetting    = changeWeapon.guns[changeWeapon.arrayIndex].GetComponent <WeaponSetting>();
 }
Example #2
0
 // Use this for initialization
 void Start()
 {
     weapon       = GameObject.FindGameObjectWithTag("HUDWeapon");
     hudWeapon    = weapon.GetComponent <HudWeapon>();
     weaponHolder = GameObject.FindGameObjectWithTag("WeaponHolder");
     swapWeapon   = weaponHolder.GetComponent <ChangeWeapon>();
 }
Example #3
0
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
         	myTransform = transform;
            cameraHeadTransform = myTransform.FindChild ("CameraHead");

            //Find SpawnManager and get SpawnScript for team
            GameObject spawnManager = GameObject.Find ("SpawnManager");
            SpawnScript spawnScript = spawnManager.GetComponent<SpawnScript>();
            changeScript = myTransform.GetComponent<ChangeWeapon>();

            if(spawnScript.onRed == true)
            {
                iRed = true;
            }

            if(spawnScript.onBlue == true)
            {
                iBlue = true;
            }

            energyScript = myTransform.GetComponent<PlayerEnergy>();

        }
        else
        {
            enabled = false;
        }
    }
Example #4
0
    //Variables End___________________________________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
            //Store a reference to these objects since we will need to reference
            //them frequently.

            myTransform = transform.parent;

            cameraHeadTransform = myTransform.FindChild("CameraHead");

            resourceScript = myTransform.GetComponent<PlayerResource>();

            changeScript = myTransform.GetComponent<ChangeWeapon>();

            //Attaching a LineRenderer component which will give a visual
            //effect for the block eraser. Only the player will be able to see it.

            lineRenderer = gameObject.AddComponent<LineRenderer>();

            lineRenderer.material = new Material(Shader.Find("Particles/Additive"));

            lineRenderer.SetColors(c1, c2);

            lineRenderer.SetWidth(0.04f, 0.01f);

            lineRenderer.SetVertexCount(2); //Start and end position.
        }

        else
        {
            enabled = false;
        }
    }
Example #5
0
 void OnEnable()
 {
     damageControl = GetComponentInParent <ChangeWeapon>();
     player        = GameObject.FindGameObjectWithTag("Player");
     experience    = player.GetComponent <Experience>();
     damage        = damage + experience.damageBonus;
 }
Example #6
0
 // Use this for initialization
 void Start()
 {
     shopAudio    = GetComponent <AudioSource>();
     weaponHolder = GameObject.FindGameObjectWithTag("WeaponHolder");
     swapWeapon   = weaponHolder.GetComponent <ChangeWeapon>();
     player       = GameObject.FindGameObjectWithTag("Player");
     playerHealth = player.GetComponent <PlayerHealth>();
     weaponObject = GameObject.FindGameObjectWithTag("Weapon");
     weapon       = weaponObject.GetComponent <Weapon>();
 }
 // Use this for initialization
 void Start()
 {
     buttonZ         = new Slowtime();
     buttonX         = new NormalizeTime();
     buttonLeftMouse = new FireWeapon();
     buttonESC       = new PauseGame();
     buttonSpace     = new JumpCommand();
     buttonLeftShift = new DashCommand();
     buttonB         = new ChangeWeapon();
 }
Example #8
0
 void Awake()
 {
     if (changeWeapon == null)
     {
         changeWeapon = this;
     }
     else
     {
         Debug.Log("Not Found");
     }
 }
Example #9
0
    public void fwt()
    {
        try {
            player = GameObject.FindGameObjectWithTag("Player");

            PlayerLoad      = player.GetComponent <onLoadPlayer>();
            playerScript    = player.GetComponent <CharacterScript>();
            ChangeEquipment = player.GetComponent <ChangeWeapon>();
        }
        catch {
            Debug.Log("Inventory could not find with tag");
        }
    }
    //Variables End___________________________________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
            myTransform = transform;

            myCameraHeadTransform = myTransform.FindChild("CameraHead");

            constructionGuideBlock = GameObject.Find("ConstructionBlockGuide");

            changeScript = myTransform.GetComponent<ChangeWeapon>();
        }

        else
        {
            enabled = false;
        }
    }
Example #11
0
    // Start is called before the first frame update
    void Start()
    {
        interaction            = FindObjectOfType <InteractionUni>();
        terminalCamera.enabled = false;
        weapon     = FindObjectOfType <ChangeWeapon>();
        flashLight = FindObjectOfType <FlashLight>();
        move       = FindObjectOfType <PlayerMove>();
        mDoc       = FindObjectOfType <MissionDocument>();
        eq         = FindObjectOfType <EquipmentSystem>();
        TextAsset asset = (TextAsset)Resources.Load(@"TerminalSCP\SCPTerminal");

        terminalXML = new XmlDocument();
        terminalXML.LoadXml(asset.text);
        textLogo.text = terminalXML.GetElementsByTagName("title")[0].InnerText;
        settings      = FindObjectOfType <Settings_options>();
        source        = GetComponent <AudioSource>();
        LoadText("back", 0);
    }
Example #12
0
    public void Equip()
    {
        ChangeEquipment = GameObject.FindGameObjectWithTag("Character").GetComponent <ChangeWeapon>();

        foreach (List <string> equipment in inventoryArray)
        {
            string nameOfItem = equipment[0];
            string collection = equipment[1];
            string typeOfItem = equipment[2];
            ChangeEquipment.changeWeapon(nameOfItem, collection, typeOfItem);
            foreach (List <int> valueProperty in inventoryIntArray)
            {
                if (typeOfItem.ToLower() == "sword")
                {
                    attack = valueProperty[1];
                }
                else if (typeOfItem.ToLower() == "armour")
                {
                    //add defence, but did it in buy item instead
                }
            }
        }
    }
Example #13
0
    //Variables End___________________________________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
            myTransform = transform;

            cameraHeadTransform = myTransform.FindChild("CameraHead");

            weaponScript = myTransform.GetComponent<ChangeWeapon>();

            energyScript = myTransform.GetComponent<PlayerEnergy>();

            //Access the SpawnScript and find out what team this player
            //is on. The rocket that is instantiated depends
            //on what team the player is on.

            GameObject SpawnM = GameObject.Find("SpawnManager");

            SpawnScript spawnScript = SpawnM.GetComponent<SpawnScript>();

            if(spawnScript.onRed == true)
            {
                iAmOnRedTeam = true;
            }

            if(spawnScript.onBlue == true)
            {
                iAmOnBlueTeam = true;
            }
        }

        else
        {
            enabled = false;
        }
    }
Example #14
0
 private void Start()
 {
     cH = FindObjectOfType <ChangeWeapon>();
 }
    //Variables End___________________________________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
            parentTransform = transform.parent;

            cameraHeadTransform = parentTransform.FindChild("CameraHead");

            weaponScript = parentTransform.GetComponent<ChangeWeapon>();

            energyScript = parentTransform.GetComponent<PlayerEnergy>();

            style.fontSize = 40;
            style.normal.textColor = Color.red;
            style.fontStyle = FontStyle.Bold;
            style.alignment = TextAnchor.MiddleCenter;

            //Check which team this player is on. This will determine
            //who can get hurt by this player's beam.

            GameObject SpawnM = GameObject.Find("SpawnManager");

            SpawnScript script =  SpawnM.GetComponent<SpawnScript>();

            if(script.onRed == true)
            {
                iAmOnRedTeam = true;
            }

            if(script.onBlue == true)
            {
                iAmOnBlueTeam = true;
            }
        }

        else
        {
            enabled = false;
        }
    }
Example #16
0
    //Variables End_____________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
            myTransform = transform;

            motorScript = myTransform.GetComponent<CharacterMotor>();

            playerGraphics = myTransform.FindChild("Graphics");

            trigger = myTransform.FindChild("Trigger").gameObject;

            cameraHead = myTransform.FindChild("CameraHead");

            fallDamageScript = myTransform.GetComponent<FallDamage>();

            changeScript = gameObject.GetComponent<ChangeWeapon>();
            energyScript = gameObject.GetComponent<PlayerEnergy>();

        }

        else
        {
            enabled = false;
        }
    }
    //Variables End___________________________________________________________
    // Use this for initialization
    void Start()
    {
        if(networkView.isMine == true)
        {
            myTransform = transform;

            //The ray is cast based on the direction the camera head is facing
            //Remember the camera head tilts up and down because of the
            //MouseLook script attached to it.

            myCameraHeadTransform = myTransform.FindChild("CameraHead");
            resourceScript = gameObject.GetComponent<PlayerResource>();

            changeScript = myTransform.GetComponent<ChangeWeapon>();
        }

        else
        {
            enabled = false;
        }
    }