Ejemplo n.º 1
0
    /// <summary>
    /// 打开该开关
    /// </summary>
    /// <param name="triggerType"></param>
    public override void Trigger(TiggerType triggerType)
    {
        //检测是否有该触发条件
        if (triggerConditionsDic.ContainsKey(triggerType))
        {
            triggerConditionsDic[triggerType] = true;

            //检测所有触发条件是否满足
            if (TriggerDetect())
            {
                isTriggered = true;

                //检测所有组合机关是否已经触发
                bool isAllTriggered = true;
                foreach (GameObject comMechanism in combinationMechanisms)
                {
                    //如果没触发
                    if (!comMechanism.GetComponent <Mechanism>().IsTriggered())
                    {
                        isAllTriggered = false;
                        break;
                    }
                }

                //如果其他组合机关全部打开,则触发
                if (isAllTriggered)
                {
                    enabled = true;
                }
            }
        }
    }
Ejemplo n.º 2
0
 public override void Trigger(TiggerType triggerType)
 {
     if (TriggerDetect())
     {
         isTriggered = true;
         enabled     = true;
     }
 }
Ejemplo n.º 3
0
 public override void Trigger(TiggerType triggerType)
 {
     if (TriggerDetect())
     {
         isTriggered = true;
         mechanism.Trigger(Mechanism.TiggerType.Switch);
     }
 }
Ejemplo n.º 4
0
 public override void Trigger(TiggerType triggerType)
 {
     if (TriggerDetect())
     {
         //检测冰属性
         if (triggerType == Mechanism.TiggerType.Ice)
         {
             Froze();
             isTriggered = true;
         }
     }
 }
Ejemplo n.º 5
0
 public override void Trigger(TiggerType triggerType)
 {
     if (TriggerDetect())
     {
         if (triggerType == TiggerType.Fire)
         {
             //冰融化成水
             Melt();
             isTriggered = true;
         }
     }
 }
Ejemplo n.º 6
0
    public override void Trigger(TiggerType triggerType)
    {
        if (TriggerDetect())
        {
            //触发
            isTriggered = true;

            //恢复速度
            speed = originalFlowSpeed;

            //开启脚本
            enabled = true;
        }
    }
Ejemplo n.º 7
0
    public override void Trigger(TiggerType triggerType)
    {
        //判断攻击类型是否为火
        if (triggerType == Mechanism.TiggerType.Fire)
        {
            isAttackedByFire = true;
        }

        //检测触发条件
        if (TriggerDetect())
        {
            light.enabled = true;
        }
    }
Ejemplo n.º 8
0
    /// <summary>
    /// 触发机关,根据跳跃次数改变角度
    /// </summary>
    /// <param name="triggerType"></param>
    public override void Trigger(TiggerType triggerType)
    {
        //跳跃次数为奇数
        if (jumpNum == 1)
        {
            rotationAngle.z = angle1;
        }
        //跳跃次数为偶数
        else if (jumpNum == 2)
        {
            rotationAngle.z = angle2;
        }

        //改变角度
        transform.rotation = Quaternion.Euler(rotationAngle);
    }
Ejemplo n.º 9
0
    /// <summary>
    /// 被指定元素触发,触发相应机关
    /// </summary>
    /// <param name="triggerType"></param>
    public override void Trigger(TiggerType triggerType)
    {
        //判断是否被指定类型条件触发
        if (triggerType == acceptTriggerType)
        {
            isAttacked = true;
        }

        //检查是否满足触发条件
        if (TriggerDetect())
        {
            //机关触发生效
            isTriggered = true;
            enabled     = true;
        }
    }
Ejemplo n.º 10
0
    public override void Trigger(TiggerType triggerType)
    {
        if (triggerType == type)
        {
            isAttacked = true;
        }

        if (TriggerDetect())
        {
            mechanism.GetComponent <Mechanism>().Trigger(TiggerType.Switch);

            //机关失效
            enabled     = false;
            isTriggered = true;
        }
    }
Ejemplo n.º 11
0
 /// <summary>
 /// 触发机关
 /// </summary>
 public abstract void Trigger(TiggerType triggerType);
Ejemplo n.º 12
0
 /// <summary>
 /// 触发
 /// </summary>
 /// <param name="triggerType"></param>
 public override void Trigger(TiggerType triggerType)
 {
     enabled = true;
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 此机关中不用
 /// </summary>
 /// <param name="triggerType"></param>
 public override void Trigger(TiggerType triggerType)
 {
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 触发(消失)
 /// </summary>
 /// <param name="triggerType"></param>
 public override void Trigger(TiggerType triggerType)
 {
     StartCoroutine(nameof(Disappear));
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 触发机关(开启宝箱)
 /// </summary>
 /// TODO 开启宝箱该做什么?
 public override void Trigger(TiggerType triggerType)
 {
     isOpen = true;
 }
Ejemplo n.º 16
0
 public override void Trigger(TiggerType triggerType)
 {
     GameObject.Destroy(gameObject);
 }