Beispiel #1
0
    private void OnEnable()
    {
        sb = (ShooterBehaviour)target;
        GetTools();

        if (sb.sensorSet != null)
        {
            vs = sb.sensorSet.sensorList.Find(x => x.GetType() == typeof(SensorVisual)) as SensorVisual;
            hr = sb.sensorSet.sensorList.Find(x => x.GetType() == typeof(SensorHearing)) as SensorHearing;
        }
    }
    private void Start()
    {
        iS = gameObject.AddComponent <InputSettings>();

        camRig = GetComponentInChildren <CameraRig>();
        sB     = GetComponent <ShooterBehaviour>();

        if (isController)
        {
            iS.SwitchToController();
        }
    }
Beispiel #3
0
        public override void OnStart(AIBrain ai)
        {
            foreach (Transform t in ai.Transform.GetComponentsInChildren <Transform>())
            {
                if (t.CompareTag("Target"))
                {
                    target = t;
                    t.GetComponent <AiTargetLogic>().ai  = ai;
                    t.GetComponent <AiTargetLogic>().ssw = this;

                    weaponIKParent = target.parent;
                }
            }
            foreach (Transform t in ai.Transform.GetComponentsInChildren <Transform>())
            {
                if (t.CompareTag("RightHandHold"))
                {
                    RightHandHold = t.FindChild("PosRotFixer");
                }
            }
            foreach (Transform t in ai.Transform.GetComponentsInChildren <Transform>())
            {
                if (t.CompareTag("LeftHandHold"))
                {
                    LeftHandHold = t.FindChild("PosRotFixer");
                }
            }
            foreach (Transform t in ai.Transform.GetComponentsInChildren <Transform>())
            {
                if (t.CompareTag("WeaponIK"))
                {
                    WeaponIK = t.FindChild("PosRotFixer");
                }
            }
            if (fireProps.weapons != null && fireProps.weapons.Count > 0)
            {
                ai.CurrentWeapon = fireProps.weapons[fireProps.startWeaponIndex > fireProps.weapons.Count - 1 ? 0 : fireProps.startWeaponIndex];
            }

            ShooterBehaviour sb = ai.Transform.GetComponent <ShooterBehaviour>();

            if (sb)
            {
                sb.onIsHandOnGun        += OnIsHandOnGun;
                sb.onIsHandAwayFromGun  += OnIsHandAwayFromGun;
                sb.onNewClipInLeftHand  += OnNewClipInLeftHand;
                sb.onNewClipOffLeftHand += OnNewClipOffLeftHand;
                sb.onReloadDone         += OnReloadDone;
            }
        }
Beispiel #4
0
        private void Start()
        {
            iB = GetComponent <InputBehaviour>();
            mB = GetComponent <MovementBehaviour>();
            sB = GetComponent <ShooterBehaviour>();
            tB = GetComponent <TeamMemberBehaviour>();
            hB = GetComponent <HealthBehaviour>();

            cB = GetComponentInChildren <CameraBehaviour>();

            audioHandler = GetComponent <PlayerSoundHandler>();

            points = 0;
        }
 private void Start()
 {
     sb = GetComponent <ShooterBehaviour>();
 }
Beispiel #6
0
 private void Start()
 {
     cC = GetComponent <CharacterController>();
     sB = GetComponent <ShooterBehaviour>();
 }
Beispiel #7
0
 private void Start()
 {
     //Referencia a enemigo
     shooter = GetComponent <ShooterBehaviour>();
 }