Example #1
0
    void Start()
    {
        //this.GetComponentInChildren<RifleController>().enabled = false;
        rifle        = GameObject.Find("Rifle");
        shootyScript = rifle.GetComponent <RifleController>();

        shootyScript.enabled = false;
        rifle.SetActive(false);
        //this.GetComponentInChildren<TestScript>().enabled = false;
        //Sword = GameObject.Find("Sword");
        //Sword.SetActive(false);
    }
Example #2
0
    private void Start()
    {
        myRigid    = GetComponent <Rigidbody>();
        myCollider = GetComponent <CapsuleCollider>();
        anim       = GetComponent <Animator>();

        // Weapon
        rifleController       = GetComponent <RifleController>();
        baseballBatController = GetComponent <BaseballBatController>();
        bowController         = GetComponent <BowController>();

        // viewCamera = Camera.main; // 메인카메라
    }
    private void Awake()
    {
        oldAnimationSpeed = 1;
        animator          = gameObject.GetComponent <Animator>();
        chrContr          = gameObject.GetComponent <CharacterController>();
        grenadeProp       = Resources.Load("Prefabs/GrenadeProp") as GameObject;
        grenadeObj        = Resources.Load("Prefabs/Grenade") as GameObject;
        //leftHand = transform.GetChild(0).gameObject;
        rightHand = transform.GetChild(1).gameObject;

        stepsSound      = GetComponent <AudioSource>();
        rifleController = gameObject.GetComponent <RifleController>();
    }
    void Start()
    {
        rifleController = rifleGameObject.GetComponent <RifleController> ();
        rifleInfo       = rifleGameObject.GetComponent <RifleInfo> ();
        playerRigidbody = GetComponent <Rigidbody> ();

        startScale = playerSpriteGameObject.transform.localScale;

        isInvincibility = false;

        playerSpriteRenderer = playerSpriteGameObject.GetComponent <SpriteRenderer> ();
        spriteStartColor     = playerSpriteRenderer.color;
        spriteCurrentColor   = spriteStartColor;
    }
    private void Awake()
    {
        player = GameObject.FindGameObjectWithTag("Player");

        timeText          = hudPanel.transform.GetChild(0).gameObject.GetComponent <Text>();
        trialText         = hudPanel.transform.GetChild(1).gameObject.GetComponent <Text>();
        currentWeaponText = hudPanel.transform.GetChild(2).gameObject.GetComponent <Text>();
        playerHP          = hudPanel.transform.GetChild(3).gameObject.GetComponent <Text>();
        weaponAmmo        = hudPanel.transform.GetChild(4).gameObject.GetComponent <Text>();

        enemyName = enemyStatusPanel.transform.GetChild(0).gameObject.GetComponent <Text>();
        enemyHP   = enemyStatusPanel.transform.GetChild(1).gameObject.GetComponent <Text>();

        playerHealth    = player.GetComponent <HealthPoints>();
        rifleController = player.GetComponent <RifleController>();
        promptText      = promptPanel.transform.GetChild(0).gameObject.GetComponent <Text>();
    }
 private void Awake()
 {
     rifleController = GameObject.FindGameObjectWithTag("Player").GetComponent <RifleController>();
 }
Example #7
0
 // Use this for initialization
 void Awake()
 {
     instance = this;
 }