コード例 #1
0
    public AnimationsHolder load(PlayerTexture playertex)
    {
        Sprite[]         animationsprites = divideTexture(playertex.sprite, playertex.config.frames_per_line, 4, playertex.config.width, playertex.config.height, playertex.config.pixel_per_unit);
        AnimationsHolder animations       = new AnimationsHolder();
        int i = 0;

        animations.Iddle = animationsprites [i];
        i++;
        animations.DownAnimation = loadArray(animations.DownAnimation, animationsprites, playertex.config.frames_per_line, i);
        i = i + (playertex.config.frames_per_line - 2);
        animations.IddleDown = animationsprites [i];
        i = i + 2;
        animations.UpAnimation = loadArray(animations.UpAnimation, animationsprites, playertex.config.frames_per_line, i);
        i = i + (playertex.config.frames_per_line - 2);
        animations.IddleUp = animationsprites [i];
        i = i + 2;
        animations.LeftAnimation = loadArray(animations.LeftAnimation, animationsprites, playertex.config.frames_per_line, i);
        i = i + (playertex.config.frames_per_line - 2);
        animations.IddleLeft = animationsprites [i];
        i = i + 2;
        animations.RightAnimation = loadArray(animations.RightAnimation, animationsprites, playertex.config.frames_per_line, i);
        i = i + (playertex.config.frames_per_line - 2);
        animations.IddleRight = animationsprites [i];

        return(animations);
    }
コード例 #2
0
    // Use this for initialization

    void Start()
    {
        match_music.clip = staticstuff.SelectedMusic.audio;
        Onsetfile        = staticstuff.SelectedMusic.onset;
        segmentfile      = staticstuff.SelectedMusic.segment;
        Beatfile         = staticstuff.SelectedMusic.beat;
        Pitchfile        = staticstuff.SelectedMusic.pitch;

        parser       = new CSVParser();
        musicinfo    = new MusicInfoScript();
        musicprocess = new MusicProcessor(musicinfo);
        bulletsystem = new BulletSystemControl(defaultenemybullet, origin, bulletrepo);
        bulletcontroler.musicinfo = musicinfo;


        musicprocess.processMusicOnset(parser.parseFile(Onsetfile));
        musicprocess.processMusicSegment(parser.parseFile(segmentfile));
        musicprocess.processMusicBeat(parser.parseFile(Beatfile));
        musicprocess.processMusicPitch(parser.parseFile(Pitchfile));
        Debug.Log("music loaded");

        musicinfo.calculateValues();
        Debug.Log("Info calced");

        bulletsystem.createpatterns(musicinfo);
        Debug.Log("Patterns loaded");

        bulletcontroler.loadBullets(bulletsystem.createBullets());
        Debug.Log("bullets created");


        loadanim   = new LoadAnimation();
        animations = loadanim.load(staticstuff.SelectedSprite);
        shipanimations.Init(animations, staticstuff.SelectedSprite.config.frame_length, staticstuff.SelectedSprite.config.frames_per_line - 2);
        colliderbox.size = (new Vector2((float)(staticstuff.SelectedSprite.config.width / staticstuff.SelectedSprite.config.pixel_per_unit * 0.6), (float)(staticstuff.SelectedSprite.config.height / staticstuff.SelectedSprite.config.pixel_per_unit * 0.6)));
        Debug.Log("sprite loaded");


        player.Xvelocity        = staticstuff.config.x_velocity;
        player.Yvelocity        = staticstuff.config.y_velocity;
        player.usemouse         = staticstuff.config.use_mouse;
        player.mousesensitivity = staticstuff.config.mouse_sensitivity;
        Debug.Log("loaded config");

        int musiclength = (int)match_music.clip.length;


        enemy.sethp(7 * (musiclength / 10));
        player.sethp(5 * (musiclength / 10));
        enemy.punchdmg = (int)player.HP / 20;

        hud.musiclenght = musiclength;
        bulletcontroler.audiosource.Play();
        Cursor.visible = false;
        Debug.Log("Music activated START THE HELL");
    }
コード例 #3
0
 void Awake()
 {
     _animHolder       = GetComponent <AnimationsHolder>();
     _mouse            = GetComponent <LookAtMouse>();
     graphics          = transform;
     rigid             = GetComponent <Rigidbody2D>();
     _audioSource      = GetComponent <AudioSource>();
     _audioClip        = Resources.Load("Audio/Footstep") as AudioClip;
     _audioSource.clip = _audioClip;
 }
コード例 #4
0
 // Use this for initialization
 void Awake()
 {
     _player           = GameObject.FindGameObjectWithTag("Player");
     _MuzzleObj        = GameObject.FindGameObjectWithTag("Muzzle");
     _ShoulderObj      = GameObject.FindGameObjectWithTag("Shoulder");
     _bullet           = Resources.Load("Prefabs/Plasma_Bullet") as GameObject;
     _animationsHolder = _player.GetComponent <AnimationsHolder>();
     _mouse            = _player.GetComponent <LookAtMouse>();
     _audioSource      = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AudioSource>();
     _clip             = Resources.Load("Audio/Gunsound") as AudioClip;
 }
コード例 #5
0
 public void Init(AnimationsHolder animations, float framelength, int last)
 {
     lastframe        = last - 1;
     shipanimator     = animations;
     iddle            = true;
     this.framelength = framelength;
     if (staticstuff.config.use_mouse)
     {
         horizontal = "MouseHorizontal";
         vertical   = "MouseVertical";
     }
     else
     {
         horizontal = "Horizontal";
         vertical   = "Vertical";
     }
 }
コード例 #6
0
 void Awake()
 {
     _animHolder = GetComponent <AnimationsHolder>();
 }