Ejemplo n.º 1
0
    public void SetData(Hero[] characters, Monster[] monsters)
    {
        controller = this;
        var entries = new List <TimeLineEntry>();

        _entries.Clear();
        ClearEntries();

        foreach (var character in characters)
        {
            var entry = Instantiate(prefabPlayerEntry, container);
            entry.SetData(DataHolder._data.raceImages[(int)character.race], character.id, character.Sub.speed);
            entry.ResetPosition();
            entries.Add(entry);
            character.OnCharacterDeath.AddListener(RemoveEntry);
        }

        foreach (var monster in monsters)
        {
            var entry = Instantiate(prefabEnemyEntry, container);
            entry.SetData(monster.icon, monster.id, monster.Sub.speed);
            entry.ResetPosition();
            entries.Add(entry);
            monster.OnCharacterDeath.AddListener(RemoveEntry);
        }
        entries = entries.OrderByDescending(e => e.Speed).ToList();

        foreach (var entry in entries)
        {
            _entries.Enqueue(entry);
        }
        SetPosition();
    }
Ejemplo n.º 2
0
    public static TimeLineController GetTimelineControl(string config, string timelineName)
    {
        TimeLineController controller = null;

        //这里做个cache,避免重复创建
        controller = new TimeLineController(config, timelineName);
        return(controller);
    }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         TimeLineController ctrl = ResourceManager.Instance.LoadResource("Pivot").GetComponentInChildren <TimeLineController>();
     }
     else if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         ResourceManager.Instance.LoadResource("180Step");
     }
 }
    void Awake()
    {
        if (instance)
        {
            DestroyImmediate(gameObject);
            return;
        }
        instance = this;

        //mainPD = GetComponent<PlayableDirector> ();//GameObject.FindGameObjectWithTag ("TimeLine").GetComponent<PlayableDirector> ();
    }
Ejemplo n.º 5
0
    //创建相关对象
    IEnumerator CollectSubItems()
    {
        controller = TimeLineController.GetTimelineControl(config, config);
        yield return(null);

        while (!controller.isInitOk)
        {
            yield return(50);
        }
        //创建虚拟相机prefeb

        //下载fomd需要的资源
        //创建演员
        CreateActors(controller.Data.actorDatas);
        //设置相机,将相机的动态数据赋值

        isInitOk = true;
    }
Ejemplo n.º 6
0
 void Awake()
 {
     timeLineController = GetComponent <TimeLineController>();
     timeLineMove       = GetComponent <TimeLineMove>();
 }
Ejemplo n.º 7
0
 private void Awake()
 {
     timeLine = GameObject.Find("TimeLine").GetComponent <TimeLineController>();
 }