public void SpawnHormone(HormoneData hormoneData)
    {
        Hormone newHormone
            = Instantiate(hormonePrefab, transform)
              .GetComponent <Hormone>();

        newHormone.data = hormoneData;
        StartCoroutine(newHormone.Run(spline, OnAppear, OnSet, OnDisappear, OnRelease));
    }
示例#2
0
        public static void Inject(Hormone hormone)
        {
            var availableBindings = Bindings.Keys;
            var actions           = availableBindings
                                    .Where(x =>
                                           hormone.GetType() == x || x.IsAssignableFrom(hormone.GetType())
                                           )
                                    .SelectMany(x => Bindings[x]);

            Parallel.ForEach(actions, (action, b, d) => {
                action.Invoke(hormone);
            });
        }
示例#3
0
    private void OnHormoneSetted(Hormone hormone)
    {
        if (!displayedHormones.Contains(hormone.data.id))
        {
            displayedHormones.Add(hormone.data.id);
            PauseManager.Instance.ShowModal(new Vector3(0, 0, 0), texts.Hormones[hormone.data.id]);
        }

        if (displayedHormones.Count >= texts.Hormones.Count())
        {
            PlayerPrefs.SetString(
                "Tuition_Hormones",
                JsonUtility.ToJson(displayedHormones));

            HormoneSpawner.OnSet -= OnHormoneSetted;
        }
    }
示例#4
0
文件: Cell.cs 项目: cohen990/cell
 protected void Emit(Hormone hormone)
 {
     EndocrineSystem.Inject(hormone);
 }
示例#5
0
 private void SetHormoneTouchTime(Hormone hormone)
 {
     necessaryTouchTime = hormone.data.necessaryTouchTime;
 }
示例#6
0
 public void SetHormone(Hormone hormone, float moveTime)
 {
     StartCoroutine(ToHormone(hormone.data, moveTime));
 }