Exemplo n.º 1
0
    // ______________________________________
    //
    // 1. MONOBEHAVIOUR LIFE CYCLE.
    // ______________________________________
    //

    void Awake()
    {
        Singleton                      = this;
        Rhythms                        = new List <Rhythm_Data>();
        separators                     = new List <List <Image> >();
        numerations                    = new List <RectTransform>();
        Sound_Type_Mono.Sounds         = new List <Sound_Type_Mono>();
        Sound_Type_Mono.Selected_Sound = null;
        Rhythm_Loop.Selected           = null;
        Step = 0.125f;
        content_rect_transform = transform.parent.GetComponent <RectTransform>();
        color_separator_dark   = separator_dark_prefab.GetComponent <Image>().color;
        color_separator_light  = separator_prefab.GetComponent <Image>().color;
    }
Exemplo n.º 2
0
    public void Load()
    {
        Fire_Time = Rhythm_Player.Round_To_Existing_Key_Floor(Fire_Time);
        Rhythm_Player.Singleton.Time_Events[Fire_Time] += On_Time;

        if (Instance != null)
        {
            Volume = Instance.Volume;
        }

        if (Enabled)
        {
            Rhythm_Player.Singleton.Time_Events[Fire_Time] += sound.On_Time;
        }
    }
Exemplo n.º 3
0
    void IEndDragHandler.OnEndDrag(PointerEventData eventData)
    {
        float diff, length, time_diff;

        if (type != Border_Type.End)
        {
            diff = loop.transform.localPosition.x - start;

            Debug.Log("Diff: " + diff);

            length = loop.Data.Length;
            loop.Data.Start_Time = loop.Data.End_Time - length;
            time_diff            = Rhythm_Player.Round_To_Existing_Key(Rhythm_Player.Position_To_Timer(diff, false));

            loop.transform.localPosition = new Vector3(start + Rhythm_Player.Timer_To_Position(time_diff, false), loop.transform.localPosition.y);
            Debug.Log("Time_Diff: " + time_diff);

            loop.Data.Start_Time += time_diff;
            loop.Data.End_Time   += time_diff;

            loop.Update_Core();
            loop.Update_Periphery();
            return;
        }

        diff = transform.localPosition.x - start;

        Debug.Log("Diff: " + diff);

        time_diff = Rhythm_Player.Round_To_Existing_Key(Rhythm_Player.Position_To_Timer(diff, false));

        transform.localPosition = new Vector3(start + Rhythm_Player.Timer_To_Position(time_diff, false), transform.localPosition.y);
        Debug.Log("Time_Diff: " + time_diff);

        loop.Data.End_Time += time_diff;

        loop.Update_Core();
        loop.Update_Periphery();
        return;
    }