示例#1
0
    private void Update()
    {
        if (Abort)
        {
            Conductors.ForEach(conductor => conductor.ConductAbortion());
            Conductors.ForEach(conductor => conductor.ConductConclusion());
            Destroy(gameObject);
            return;
        }

        if (Inhibitors.All(inhibitor => inhibitor.AllowUpdate))
        {
            Conductors.ForEach(conductor => conductor.ConductUpdate());
        }
        else
        {
            Conductors.ForEach(conductor => conductor.ConductTermination());
            Conductors.ForEach(conductor => conductor.ConductConclusion());
            Destroy(gameObject);
            return;
        }

        if (Inhibitors.All(inhibitor => inhibitor.AllowCompletion))
        {
            Conductors.ForEach(conductor => conductor.ConductCompletion());
            Conductors.ForEach(conductor => conductor.ConductConclusion());
            Destroy(gameObject);
        }
    }
示例#2
0
    private void Start()
    {
        if (Owner.Fetch() == null)
        {
            return;
        }

        if (Owner.Instance.Auras.Lacks(this))
        {
            Owner.Instance.Auras.Fetch();
        }

        if (Inhibitors.All(inhibitor => inhibitor.AllowStart))
        {
            Conductors.ForEach(conductor => conductor.ConductStart());
        }
        else
        {
            Conductors.ForEach(conductor => conductor.ConductTermination());
            Conductors.ForEach(conductor => conductor.ConductConclusion());
            Destroy(gameObject);
        }
    }