Ejemplo n.º 1
0
 public Note(Note note)
 {
     this.position   = note.position;
     this.type       = note.type;
     this.next       = note.next;
     this.prev       = note.prev;
     this.attributes = note.attributes;
     this.direction  = note.direction;
 }
Ejemplo n.º 2
0
    public static Vector2 GetNotePos(NoteAttributes NoteAtt) //Returns where a note should spawn
    {
        Vector2 pos = new Vector2();

        float offset = ((float)NoteAtt.spawnTick / 44100.0f);

        pos.y = NoteAtt.yOffset;
        pos.x = -offset;
        return(pos);
    }
Ejemplo n.º 3
0
    //Turns a noteAttribute into a gameObject
    public static GameObject NoteToObject(NoteAttributes AttributeClass)
    {
        GameObject temp = GameObject.Instantiate(Resources.Load("Prefabs/CustomEditor/musicNote") as GameObject);

        temp.name = "Note";
        temp.GetComponent <AttributeHolder>().setNote(AttributeClass);
        temp.transform.position = GetNotePos(AttributeClass);
        temp.tag = "note";

        return(temp);
    }
Ejemplo n.º 4
0
    public void createNote()
    {
        GameObject     listObject = GameObject.Find("soundManager");
        NoteAttributes NA         = new NoteAttributes();

        NA.spawnTick  = soundSource.timeSamples;
        NA.speed      = 1.0f;
        NA.myNoteType = noteType.Tap;
        GameObject newNote = NoteHelper.NoteToObject(NA);

        newNote.tag = "note";
        newNote.transform.position      = new Vector2(0, 0);
        newNote.transform.localPosition = Vector2.zero;
    }
Ejemplo n.º 5
0
        public void LoadNotesPtr(ref PartsObject PartsObj, ref NoteObject CurrentNote)
        {
            PartsBinder.ReAlloc(PartsObj);

            NoteBinder.ReAlloc(CurrentNote);

            NoteAttributes NA = new NoteAttributes(PartsBinder.IntPtr, NoteBinder.IntPtr, ProjectBinder.IntPtr);

            NA.setSingerDataFinder(SingerDataFinder);

            NA.PhonemesChanged += NA_PhonemesChanged;

            this.PropertyViewer.Tag = NA;

            this.PropertyViewer.SelectedObject = this.PropertyViewer.Tag;
        }
Ejemplo n.º 6
0
 public void addItem(NoteAttributes NA)
 {
     notes.Add(NA);
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Evernoteに画像を送信する
        /// </summary>
        /// <param name="sendImage">送信する画像</param>
        /// <param name="EvernoteToken">Evernoteトークン</param>
        static public void SendToEvernote(List <Image> sendImages, string EvernoteToken,
                                          string evernoteNotebookName, List <string> evernoteTags, string sourceUrl)
        {
            string authToken = EvernoteToken;

            Uri        userStoreUrl       = new Uri("https://" + evernoteHost + "/edam/user");
            TTransport userStoreTransport = new THttpClient(userStoreUrl);
            TProtocol  userStoreProtocol  = new TBinaryProtocol(userStoreTransport);

            UserStore.Client userStore    = new UserStore.Client(userStoreProtocol);
            String           noteStoreUrl = userStore.getNoteStoreUrl(authToken);

            TTransport noteStoreTransport = new THttpClient(new Uri(noteStoreUrl));
            TProtocol  noteStoreProtocol  = new TBinaryProtocol(noteStoreTransport);

            NoteStore.Client noteStore = new NoteStore.Client(noteStoreProtocol);

            Note note = new Note();

            note.Title = DateTime.Now.ToShortDateString();

            foreach (var notebook in Evernote.GetEvetnoteNotebook(EvernoteToken))
            {
                if (notebook.Key == evernoteNotebookName)
                {
                    note.NotebookGuid = notebook.Value;
                    break;
                }
            }

            note.TagNames = evernoteTags;

            NoteAttributes attributes = new NoteAttributes();

            attributes.SourceURL = sourceUrl;
            note.Attributes      = attributes;

            StringBuilder content = new StringBuilder();

            content.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            content.Append("<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">");
            content.Append("<en-note>");

            note.Resources = new List <Resource>();

            foreach (var sendImage in sendImages)
            {
                ImageConverter converter = new ImageConverter();
                byte[]         image     = (byte[])converter.ConvertTo(sendImage, typeof(byte[]));
                byte[]         hash      = new MD5CryptoServiceProvider().ComputeHash(image);

                Data data = new Data();
                data.Size     = image.Length;
                data.BodyHash = hash;
                data.Body     = image;

                Resource resource = new Resource();
                resource.Mime = "image/png";
                resource.Data = data;


                note.Resources.Add(resource);

                string hashHex = BitConverter.ToString(hash).Replace("-", "").ToLower();

                content.Append("<span>");
                content.Append("<en-media type=\"image/png\" hash=\"");
                content.Append(hashHex);
                content.Append("\"/>");
                content.Append("</span>");
                content.Append("<br/>");
            }

            content.Append("</en-note>");

            note.Content = content.ToString();

            Note createdNote = noteStore.createNote(authToken, note);
        }
Ejemplo n.º 8
0
 void Start()
 {
     NA = gameObject.GetComponent <AttributeHolder>().getNote();
     SR = gameObject.GetComponent <SpriteRenderer>();
     //  InvokeRepeating("updateColor", 0.0f, 0.1f);
 }