Esempio n. 1
0
    private void Start()
    {
        hitPoints       = maxHP;
        firingComponent = new IntervalFiring();
        bulletComponent = new ScatteringBullet();

        firingComponent.Start(this);

        _tree = new Tree <BossNew>(new Selector <BossNew>(
                                       new Sequence <BossNew>(
                                           new Not <BossNew>(new IsLowHealth()), new Patrol(), new Shoot()),
                                       new Sequence <BossNew>(
                                           new IsLowHealth(), new Charge())));
    }
Esempio n. 2
0
        /// ------------------------------------------------------------------------------------------
        /// <summary>
        /// ������ʱ����ôʵ�ָ����ӵ����ӵ�2�����Ч��
        /// </summary>
        /// ------------------------------------------------------------------------------------------
        private void FireEffect2(Vector3 shootVector, Vector3 position, int randSeed)
        {
            GameObject shellInstance = null;

            if (ExplosionManager.s_InstanceExists)
            {
                shellInstance = ExplosionManager.s_Instance.CreateVisualBullet(position, shootVector, 0, BulletClass.ClusterExplosion);
            }

            shellInstance.SetActive(true);
            shellInstance.transform.localScale = Vector3.one;
            shellInstance.transform.position   = position;
            shellInstance.transform.forward    = shootVector;

            // �������������ײ
            Physics.IgnoreCollision(shellInstance.GetComponent <Collider>(), GetComponentInChildren <Collider>(), true);
            ScatteringBullet shell = shellInstance.GetComponent <ScatteringBullet>();

            shell.Setup(0, null, 100);
            shell.transform.rotation = Quaternion.Euler(new Vector3(transform.rotation.eulerAngles.x, m_curLookatDeg, transform.rotation.eulerAngles.z));
        }