Наследование: MonoBehaviour
Пример #1
0
 void Awake()
 {
     m_movement = Avatar.GetComponent<Movement>();
     m_light_attack = Avatar.GetComponent<LightAttack>();
     m_lock_on = Avatar.GetComponent<LockOn>();
     m_dodge = Avatar.GetComponent<Dodge>();
 }
Пример #2
0
    void Initialize()
    {
        if (detector == null)
        {
            this.enabled = false;
            return;
        }
        _ovrSkelton = detector.GetComponent <OVRSkeleton>();
        lockOn      = FindObjectOfType <LockOn>();


        if (_ovrSkelton == null)
        {
            return;
        }

        IndexTip = _ovrSkelton.Bones[(int)OVRSkeleton.BoneId.Hand_IndexTip].Transform;
        Index3   = _ovrSkelton.Bones[(int)OVRSkeleton.BoneId.Hand_Index3].Transform;

        StartCoroutine(ShotLoop());
        Addressables.InstantiateAsync(GunCircle).Completed += op =>
        {
            op.Result.transform.parent   = transform;
            op.Result.transform.position = IndexTip.position;
            Circle = op.Result;
        };
    }
Пример #3
0
 void Start()
 {
     l = FindObjectOfType <LockOn>();
     foreach (EnemyMovement e in EnemyList)
     {
         e.Manager = transform.gameObject;
     }
 }
Пример #4
0
    void Initialize()
    {
        if (detector == null)
        {
            this.enabled = false;
            return;
        }
        lockOn = FindObjectOfType <LockOn>();

        StartCoroutine(ShotLoop());
    }
Пример #5
0
    IEnumerator LockOn()
    {
        float      xOffset     = Random.Range(-0.2f, 0.2f);
        float      yOffset     = Random.Range(-0.2f, 0.2f);
        GameObject lockOnClone = Instantiate(lockOn,
                                             new Vector2(playerTarget.transform.position.x + xOffset, playerTarget.transform.position.y + yOffset),
                                             Quaternion.identity);

        LockOn lockon = lockOnClone.GetComponent <LockOn>();

        lockon.setOffset(xOffset, yOffset);


        yield return(new WaitForSeconds(0.4f));

        hasLocked = true;
    }
Пример #6
0
    // Grip buttons are used to lock onto an enemy, we use a sphere cast
    // to look for an enemy in front of the controller
    private void HandleGripClicked(object sender, ClickedEventArgs e)
    {
        ani.point();

        LockOn enemyLock = GetComponent <LockOn>();
        // we need to hold a reference to the enemy
        Enemy enemy;

        // do the sphere cast to get a lock on
        enemy = enemyLock.GetLock(_controller);

        // if there is an enemy
        if (enemy)
        {
            // let the player know were locked on,
            // and give them a reference to the enemy
            player.LockOntoEnemy(true, enemy);
        }
        else
        {
            player.LockOntoEnemy(false, null);
        }
    }
        protected override void ExecuteCombo(int id)
        {
            switch (id)
            {
            case 1:
                LockOn?.Invoke();
                break;

            case 0:
                LockOff?.Invoke();
                break;

            case 2:
                Interact?.Invoke();
                break;

            case 3:
                Pause?.Invoke();
                break;

            case 4:
                Jump?.Invoke();
                break;

            case 5:
                Dodge?.Invoke();
                break;

            case 11:
                Attack?.Invoke();
                break;

            case 10:
                AttackSeq?.Invoke();
                break;
            }
        }
Пример #8
0
 void Awake()
 {
     mAnimator = GetComponent<Animator>();
     mRigidbody = GetComponent<Rigidbody2D>();
     mLockOn = GetComponent<LockOn>();
 }
Пример #9
0
    void Start()
    {
        lockOn = FindObjectOfType <LockOn>();

        StartCoroutine(ShotLoop());
    }
Пример #10
0
 void Awake()
 {
     m_movement = GetComponent<Movement>();
     m_lock_on = GetComponent<LockOn>();
     m_animator = GetComponent<Animator>();
 }
Пример #11
0
 void Awake()
 {
     m_subject_motion = Subject.GetComponent<MobMotion>();
     m_subject_lock_on = Subject.GetComponent<LockOn>();
 }
 void Awake()
 {
     mMobMotion = Avatar.GetComponent<MobMotion>();
     mLockOn = Avatar.GetComponent<LockOn>();
     mAnimator = Avatar.GetComponent<Animator>();
 }
Пример #13
0
 void Awake()
 {
     m_lock_on = Avatar.GetComponent<LockOn>();
     m_sprite_renderer = GetComponent<SpriteRenderer>();
 }
Пример #14
0
 // Start is called before the first frame update
 void Start()
 {
     lockOn       = GetComponent <LockOn>();
     freeRotation = GetComponent <FreeRotation>();
 }