Exemplo n.º 1
0
    /// <summary>
    /// Init class method.
    /// </summary>
    private void Init()
    {
        // get animator component
        // _animator = GetComponent<Animator>();

        // get camera component from parent.
        _mainCamera = GetComponentInParent <Camera>();

        // get ray shooter component from camera.
        _rayShooter = GetComponentInParent <RayShooter>();

        // get audio component reference.
        _audio = GetComponent <AudioComponent>();

        // calculate heated threshold - this is used to check and update heated weapon status.
        if (plasmaGunData != null)
        {
            float temp = (float)plasmaGunData.heatedRechargeThreeshold / (float)plasmaGunData.maxPlasma;
            _heatedThreshold = temp * 100f;
        }

        // set next level data if not set ( usually when the game is initialised for the first time );
        if (plasmaGunData.nextLevel == null)
        {
            plasmaGunData.nextLevel = plasmaGunData.GetLevelDataObject(plasmaGunData.level + 1);
        }
    }
Exemplo n.º 2
0
 protected override void Start()
 {
     base.Start();
     rayShooter       = GetComponent <RayShooter>();
     forceApplier     = GetComponent <ForceApplier>();
     damageCalculator = GetComponent <DamageCalculator>();
 }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     _health        = 100;
     _ammo          = 300;
     playerMoving   = GetComponent <FPSInput>();
     playerShooting = GetComponentInChildren <RayShooter>();
 }
Exemplo n.º 4
0
    //RayShooter playerRayshooter;

    // Use this for initialization
    void Start()
    {
        playerRayShooter = GetComponentInChildren <RayShooter>();
        player           = GetComponent <PlayerCharacter>();
        _animator        = GetComponent <Animator>();
        playerFPSInput   = GetComponent <FPSInput>();
        //   playerRayshooter = GetComponentInChildren<RayShooter>();
    }
 // Use this for initialization
 void Start()
 {
     player          = GameObject.FindGameObjectWithTag("Player");
     restartHealth   = player.GetComponent <PlayerCharacter>();
     defaultPosition = restartHealth.transform.position;
     defaultRotation = restartHealth.transform.rotation;
     defaultScale    = restartHealth.transform.localScale;
     playerMoving    = GetComponent <FPSInput>();
     playerShooting  = GetComponentInChildren <RayShooter>();
 }
Exemplo n.º 6
0
    protected override void Start()
    {
        base.Start();
        ammo       = GetComponent <Ammo>();
        rayShooter = GetComponent <RayShooter>();
        if (dealDamage)
        {
            forceApplier     = GetComponent <ForceApplier>();
            damageCalculator = GetComponent <DamageCalculator>();

            if (forceApplier == null)
            {
                forceApplier = gameObject.AddComponent <ForceApplier>();
            }

            if (damageCalculator == null)
            {
                damageCalculator = gameObject.AddComponent <DamageCalculator>();
            }
        }
        _angle = Quaternion.AngleAxis(verticalAngle, Vector3.left);
    }