Beispiel #1
0
        public virtual void FireProcess()
        {
            try
            {
                var    go     = ObjectPoolerManager.GetObjectRequest(bulletPrefabName);
                Bullet bullet = go.GetComponent <Bullet>();

                bullet.SetDefaultBulletSetting(owner as Unit);

                if (posRoot != null)
                {
                    position = posRoot.transform.position;
                }
                bullet.transform.position = position + deltaPos;

                if (dirRoot != null)
                {
                    direction = dirRoot.targetDir;
                }
                bullet.targetDir = direction + fireAngle;
                bullet.moveDir   = direction + fireAngle;
            }
            catch (NullReferenceException e)
            {
                Debug.LogError(e);
            }
        }
Beispiel #2
0
        protected override void Shoot()
        {
            GameObject go     = ObjectPoolerManager.GetObjectRequest(projectile.name);
            Bullet     bullet = go.GetComponent <Bullet>();

            bullet.SetDefaultBulletSetting(owner as Unit);
        }
Beispiel #3
0
        private void OnDestroy()
        {
            if (isQuitting == false)
            {
                GameObject go = ObjectPoolerManager.GetObjectRequest(EResourceName.Effect_ShieldBreak);

                go.transform.parent   = transform.parent;
                go.transform.position = transform.position;
            }
        }
Beispiel #4
0
        protected override void ActionProcess(Trigger trigger)
        {
            try
            {
                GameObject go = ObjectPoolerManager.GetObjectRequest(prefabName);

                go.transform.position = transform.position;
                go.transform.rotation = transform.rotation;
            }
            catch (NullReferenceException e)
            {
                Debug.LogError(e);
            }
        }
Beispiel #5
0
        protected override void ActionProcess(Trigger trigger)
        {
            try
            {
                GameObject go = ObjectPoolerManager.GetObjectRequest(prefabName);

                go.transform.position = position;
                go.transform.rotation = Quaternion.Euler(0, 0, direction);
            }
            catch (Exception e)
            {
                Debug.LogWarning(e);
            }
        }
        //

        public override void Init()
        {
            base.Init();

            _shieldList.Clear();
            enableShield = false;

            for (int i = 0; i < ShieldCount; ++i)
            {
                GameObject shield = ObjectPoolerManager.GetObjectRequest(EResourceName.Effect_Shield);
                shield.transform.position = transform.position;
                shield.transform.parent   = transform;
                _shieldList.Add(shield);

                enableShield = true;
            }
        }
Beispiel #7
0
        protected override void ActionProcess(Trigger trigger)
        {
            Actor actor = ObjectPoolerManager.GetObjectRequest(prefabName).GetComponent <Actor>();

            try
            {
                actor.transform.position = position;
                actor.moveDir            = direction;

                if (isMovingActor)
                {
                    Movable move = actor.GetOperable <Movable>();
                    move.speed = speed;
                }
            }
            catch (NullReferenceException e)
            {
                Debug.LogError(e);
            }
        }
        private void FixedUpdate()
        {
            if (_shieldCount < maxShieldCount)
            {
                if (_regenProgress < shieldRegenDelay)
                {
                    _regenProgress += Time.fixedDeltaTime;
                }
                else
                {
                    _regenProgress = 0f;
                    ++_shieldCount;

                    GameObject shield = ObjectPoolerManager.GetObjectRequest(EResourceName.Effect_Shield);
                    shield.transform.position = transform.position;
                    shield.transform.parent   = transform;
                    _shieldList.Add(shield);
                }
            }
        }
Beispiel #9
0
 public new void Destroy(UObject obj)
 {
     ObjectPoolerManager.ReleaseObjectRequest(obj);
 }
Beispiel #10
0
 public new GameObject Instantiate(UObject obj)
 {
     return(ObjectPoolerManager.GetObjectRequest(obj));
 }