Example #1
0
 public BeatKey(BeatKey beatKey)
 {
     time     = beatKey.time;
     type     = beatKey.type;
     weight   = beatKey.weight;
     position = beatKey.position;
 }
Example #2
0
    private IKeyObject createKeyInstance(BeatKey beatKey)
    {
        GameObject gameObject = Instantiate(regularKeyPrefab);
        IKeyObject keyObject  = gameObject.GetComponent <IKeyObject>();

        keyObject.initial(beatKey);

        return(keyObject);
    }
Example #3
0
    public bool setPointer(int index)
    {
        if (index > beatMap.Count - 1 || index < 0)
        {
            return(false);
        }

        pointer = index;
        mReader = beatMap[pointer];

        return(true);
    }
Example #4
0
    public bool read()
    {
        if (pointer > beatMap.Count - 1)
        {
            return(false);
        }

        mReader = beatMap[pointer];
        pointer++;

        return(true);
    }
Example #5
0
    public void test()
    {
        BeatKey    beatKey = new BeatKey((int)showTime(), 1, 3, 1);
        IKeyObject keyObject;

        //if (recycleList.Count > 0)
        //{
        //    keyObject = recycleList[0];
        //    recycleList.RemoveAt(0);
        //    keyObject.initial(beatKey);
        //}
        //else
        //{
        //    keyObject = createKeyInstance(beatKey);
        //}

        keyObject = createKeyInstance(beatKey);

        showList.Add(keyObject);

        keyObject.startWork();
    }
Example #6
0
    private void readTimeLineXML(XmlReader reader)
    {
        int     time = XmlConvert.ToInt32(reader.GetAttribute("time"));
        BeatKey key;

        while (reader.Read())
        {
            if (reader.NodeType == XmlNodeType.Element && reader.Name == "key")
            {
                key          = new BeatKey();
                key.time     = time;
                key.type     = XmlConvert.ToInt32(reader.GetAttribute("type"));
                key.weight   = XmlConvert.ToInt32(reader.GetAttribute("weight"));
                key.position = XmlConvert.ToInt32(reader.GetAttribute("position"));

                beatMap.Add(key);
            }

            if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "timeline")
            {
                return;
            }
        }
    }
Example #7
0
 public void initial(BeatKey beatKey)
 {
     setTime(beatKey.time);
     setWeight(beatKey.weight);
     setPosition(beatKey.position);
 }