Ejemplo n.º 1
0
    public void Init(HumanEvent humanEvent)
    {
        // 初始化引用
        this.humanEvent = humanEvent;
        animator        = GetComponentInChildren <Animator>();
        BornPos         = transform.position; // 记录出生点位置(HOME)
        FluentText.InitPanel(transform, FluentText.transform.position - transform.position);
        Obstacle = GetComponent <NavMeshObstacle>();
        SwitchAgentObstacle(true);

        // 开始执行任务
        mission = StartCoroutine(GO());
    }
Ejemplo n.º 2
0
    public HumanEvent(HumanEvent other)
    {
        EventType = other.EventType;
        IsParty   = other.IsParty;

        Prefabs          = other.Prefabs;
        TipTexts         = other.TipTexts;
        PartyAnimations  = other.PartyAnimations;
        WordsAfterCaught = other.WordsAfterCaught;

        PoliceWarningTexts  = other.PoliceWarningTexts;
        PoliceWarningAudios = other.PoliceWarningAudios;
    }
Ejemplo n.º 3
0
    private void GenerateOne()
    {
        // 随机生成初始坐标、模型
        Vector3    bornPos    = BornPositions[Random.Range(0, BornPositions.Length)].position;
        HumanEvent humanEvent = HumanEvents[Random.Range(0, HumanEvents.Length)];
        string     prefab     = humanEvent.Prefabs[Random.Range(0, humanEvent.Prefabs.Length)];

        // 实例化
        GameObject go = resLoader.LoadSync <GameObject>(HumanPrefab).Instantiate();

        go.transform.parent   = humenRoot;
        go.transform.position = bornPos;
        // 人物模型加载
        GameObject model = resLoader.LoadSync <GameObject>(prefab).Instantiate();

        model.transform.SetParent(go.transform);
        model.transform.localPosition = Vector3.zero;

        // 初始化 Human
        Human human = go.GetComponent <Human>();

        human.Init(humanEvent);
    }
Ejemplo n.º 4
0
 public MissionCompletedNotification(HumanEvent e) : base(e)
 {
 }
Ejemplo n.º 5
0
 public MissionExpelledNotification(HumanEvent e) : base(e)
 {
 }