コード例 #1
0
    public override EFuncRet FuncExecHandler(HandleTarget Target, FuncData funcdata, FuncContext context)
    {
        try
        {
            ThriftVector3 pos = new ThriftVector3();
            pos.X = funcdata.ParamIntList[0];
            pos.Y = funcdata.ParamIntList[1];
            pos.Z = funcdata.ParamIntList[2];

            ThriftVector3 rot = new ThriftVector3();
            rot.X = 0;
            rot.Y = funcdata.ParamIntList[3];
            rot.Z = 0;

            ThriftVector3 scal = new ThriftVector3();
            scal.X = funcdata.ParamIntList[4];
            scal.Y = funcdata.ParamIntList[4];
            scal.Z = funcdata.ParamIntList[4];
            GameObject elem = EffectContainer.EffectFactory(funcdata.ParamStringList[0]);
            elem.transform.position    = pos.GetVector3();
            elem.transform.eulerAngles = rot.GetVector3();
            elem.transform.localScale  = scal.GetVector3();
        }
        catch
        {
        }

        return(EFuncRet.Continue);
    }
コード例 #2
0
    private void OnTrigger()
    {
        //try get target
        var param = m_ActionPlayer.GetActionParam();

        if (null != param && null != param.Object && param.Object is FuncContext)
        {
            FuncContext context = param.Object as FuncContext;



            var userInstance = (EFuncTarget)(m_FrameConfig.TargetType) == EFuncTarget.EFT_Target
                ? (context.Get(FuncContext.ContextKey.Target) as Ilife)
                : (context.Get(FuncContext.ContextKey.User) as Ilife);

            if (null == userInstance)
            {
                //target is null
                return;
            }

            var        obj         = ((CharTransformData)(((ITransformBehaviour)(userInstance)).GetTransformData())).GetGameObject();
            uint       id          = uint.Parse(m_FrameConfig.InstanceId);
            GameObject objInstance = EffectContainer.EffectFactory(m_FrameConfig.EffectName, id);
            objInstance.transform.position    = obj.transform.position + m_FrameConfig.Pos.GetVector3();
            objInstance.transform.eulerAngles = obj.transform.eulerAngles + m_FrameConfig.Rot.GetVector3();
        }
    }
コード例 #3
0
    private GameObject CreateEffect()
    {
        //try get target
        uint       id          = (uint)(m_FrameConfig.InstanceId);
        GameObject objInstance = EffectContainer.EffectFactory(m_FrameConfig.EffectName, id);


        return(objInstance);
    }
コード例 #4
0
    public bool Fire(string effectName, Color color)
    {
        if (EffectContainer.GetEffectCount() > 5)
        {
            Debuger.LogWarning("system busy");
            return(false);
        }

        m_strEffectName = effectName;

        GameObject effect = EffectContainer.EffectFactory(m_strEffectName);

        if (effect == null)
        {
            Debuger.LogWarning("can't load target effect " + m_strEffectName);
            return(false);
        }
        effect.transform.position = m_EffectPos;
        m_EffectObj = effect;

        SetEffectColor(m_EffectObj, color);
        m_Window.Reset();
        return(true);
    }
コード例 #5
0
 protected override void OnPlay()
 {
     GameObject obj = EffectContainer.EffectFactory("");
 }