Exemplo n.º 1
0
 public override void Act(BaseFSM FSM)
 {
     //MessageCenter.AddListener(EMessageType.GetHitPoint, (object obj) => { hitpoint = (Vector3)obj; });
     if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo)
     {
         if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.Thunderbolt)
         {
             if (BagManager.Instance.skillAttributesList[0].isOn)
             {
                 BagManager.Instance.UseMagic(0);
                 GameObject go = NetPoolManager.Instantiate("ThunderBolt", FSM.transform.position + FSM.transform.forward * 5, FSM.transform.rotation);
                 AudioManager.PlaySound2D("ThunderBolt").Play();
                 go.GetComponent <MagicBehaviour>().isHit = true;
                 NetworkManager.SendPlayerMagic("ThunderBolt", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation);
             }
         }
     }
     if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo)
     {
         if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.Thunderbolt)
         {
             if (BagManager.Instance.skillAttributesList[1].isOn)
             {
                 BagManager.Instance.UseMagic(1);
                 GameObject go = NetPoolManager.Instantiate("ThunderBolt", FSM.transform.position + FSM.transform.forward * 5, FSM.transform.rotation);
                 AudioManager.PlaySound2D("ThunderBolt").Play();
                 go.GetComponent <MagicBehaviour>().isHit = true;
                 NetworkManager.SendPlayerMagic("ThunderBolt", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation);
             }
         }
     }
 }
Exemplo n.º 2
0
 public override void Act(BaseFSM FSM)
 {
     if (BagManager.Instance.skillAttributesList[0].skillInfo != BagManager.Instance.NullInfo)
     {
         if (BagManager.Instance.skillAttributesList[0].skillInfo.magicProperties.magicType == MagicType.Ripple)
         {
             if (BagManager.Instance.skillAttributesList[0].isOn)
             {
                 BagManager.Instance.UseMagic(0);
                 FSM.PlayAnimation("Magic Shoot Attack");
                 GameObject go = NetPoolManager.Instantiate("Ripple", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation);
                 AudioManager.PlaySound2D("Ripple").Play();
                 go.GetComponent <MagicBehaviour>().isHit = true;
             }
         }
     }
     if (BagManager.Instance.skillAttributesList[1].skillInfo != BagManager.Instance.NullInfo)
     {
         if (BagManager.Instance.skillAttributesList[1].skillInfo.magicProperties.magicType == MagicType.Ripple)
         {
             if (BagManager.Instance.skillAttributesList[1].isOn)
             {
                 BagManager.Instance.UseMagic(1);
                 FSM.PlayAnimation("Magic Shoot Attack");
                 GameObject go = NetPoolManager.Instantiate("Ripple", GameTool.FindTheChild(FSM.gameObject, "RigLArmPalmGizmo").position, FSM.transform.rotation);
                 AudioManager.PlaySound2D("Ripple").Play();
                 go.GetComponent <MagicBehaviour>().isHit = true;
             }
         }
     }
 }
Exemplo n.º 3
0
    /// <summary>
    /// 魔法回调
    /// </summary>
    /// <param name="protocol"></param>
    private void OnPlayerMagicBack(BaseProtocol protocol)
    {
        BytesProtocol p          = protocol as BytesProtocol;
        int           startIndex = 0;

        p.GetString(startIndex, ref startIndex);
        string MagicName = p.GetString(startIndex, ref startIndex);
        float  posX      = p.GetFloat(startIndex, ref startIndex);
        float  posY      = p.GetFloat(startIndex, ref startIndex);
        float  posZ      = p.GetFloat(startIndex, ref startIndex);
        float  rotX      = p.GetFloat(startIndex, ref startIndex);
        float  rotY      = p.GetFloat(startIndex, ref startIndex);
        float  rotZ      = p.GetFloat(startIndex, ref startIndex);

        NetPoolManager.Instantiate(MagicName, new Vector3(posX, posY, posZ), Quaternion.Euler(rotX, rotY, rotZ));
    }
    /// <summary>
    /// 魔法回调
    /// </summary>
    /// <param name="protocol"></param>
    private void OnPlayerMagicBack(BaseProtocol protocol)
    {
        BytesProtocol p = protocol as BytesProtocol;
        RaycastHit    hitInfo;
        Vector3       targetPoint;
        int           startIndex = 0;

        p.GetString(startIndex, ref startIndex);
        string MagicName = p.GetString(startIndex, ref startIndex);
        float  posX      = p.GetFloat(startIndex, ref startIndex);
        float  posY      = p.GetFloat(startIndex, ref startIndex);
        float  posZ      = p.GetFloat(startIndex, ref startIndex);
        float  rotX      = p.GetFloat(startIndex, ref startIndex);
        float  rotY      = p.GetFloat(startIndex, ref startIndex);
        float  rotZ      = p.GetFloat(startIndex, ref startIndex);

        GameObject go = NetPoolManager.Instantiate(MagicName, new Vector3(posX, posY, posZ), Quaternion.Euler(rotX, rotY, rotZ));

        go.GetComponent <MagicBehaviour>().isHit = true;
        Ray ray = Camera.main.ScreenPointToRay(new Vector3(Screen.width / 2, Screen.height / 2, 0));
    }