Exemplo n.º 1
0
        void SpawnProjectile(Vector3 direction)
        {
            BaseProjectile.ProjectileParam initParam = new BaseProjectile.ProjectileParam
            {
                instigator      = gameObject,
                invokeTimeStamp = beatObjectData.time,
                duration        = _projectileReachTimeBPM,
                scale           = _size,
                speed           = beatObjectData.getModel <SPEED>().value,
                shape           = _shape
            };

            Instantiate(beatObjectData.getModel <PROJECTILE>().projectile.gameObject, transform.position, Quaternion.LookRotation(direction))
            .GetComponent <BaseProjectile>()
            .Init(initParam);
        }
Exemplo n.º 2
0
        void SpawnProjectile(Vector3 direction)
        {
            GameObject projectileObj = Instantiate(_projectileObject.gameObject, transform.position + direction * _size,
                                                   Quaternion.LookRotation(direction));

            BaseProjectile.ProjectileParam initParam = new BaseProjectile.ProjectileParam
            {
                instigator      = gameObject,
                invokeTimeStamp = beatObjectData.time,
                duration        = _duration,
                appearTime      = _appear,
                scale           = _size,
            };

            projectileObj.GetComponent <BaseProjectile>().Init(initParam);
            projectileObj.transform.parent = transform;
        }
Exemplo n.º 3
0
        void Shoot()
        {
            float speed = beatObjectData.tryGetModel <SPEED>(out var speedModel) ? speedModel.value : 0.0f;
            Mesh  shape = beatObjectData.tryGetModel <SHAPE>(out var shapeModel) ? shapeModel.mesh : null;

            BaseProjectile.ProjectileParam initParam = new BaseProjectile.ProjectileParam
            {
                instigator      = gameObject,
                invokeTimeStamp = beatObjectData.time,
                duration        = duration,
                appearTime      = appear,
                scale           = size,
                speed           = speed,
                shape           = shape
            };

            Instantiate(projectile.gameObject, transform.position, transform.rotation)
            .GetComponent <BaseProjectile>()
            .Init(initParam);
        }