Ejemplo n.º 1
0
 protected override bool Trigger()
 {
     base.Trigger();
     if (World)
     {
         Transform p = Skill.Caster.Avatar.GetBindTransform(CasterBind);
         Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, Retain);
         Unit.CacheTransform.parent           = p;
         Unit.CacheTransform.localPosition    = Offset;
         Unit.CacheTransform.localEulerAngles = Euler;
         Unit.CacheTransform.parent           = null;
         Unit.CacheTransform.localScale       = Scale;
         Unit.CacheTransform.localEulerAngles = Euler + Skill.Caster.Euler;
     }
     else
     {
         Transform p = Skill.Caster.Avatar.GetBindTransform(CasterBind);
         Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, GTTransform.Create(Offset, Euler, Scale), p, Retain);
     }
     for (int i = 0; i < Children.Count; i++)
     {
         Children[i].ApplyCenter   = Unit.CacheTransform;
         Children[i].ApplyHitPoint = Unit.Pos;
         Children[i].ApplyHitDir   = Vector3.zero;
     }
     Unit.Release(Duration);
     return(true);
 }
Ejemplo n.º 2
0
        protected override bool MakeResult(Character cc)
        {
            if (cc == null)
            {
                return(false);
            }
            EffectData unit = null;

            if (World)
            {
                Transform p = cc.Avatar.GetBindTransform(Bind);
                unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, Retain);
                unit.CacheTransform.parent           = p;
                unit.CacheTransform.localPosition    = Offset;
                unit.CacheTransform.localEulerAngles = Euler;
                unit.CacheTransform.parent           = null;
                unit.CacheTransform.localScale       = Scale;
            }
            else
            {
                Transform p = cc.Avatar.GetBindTransform(Bind);
                unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, GTTransform.Create(Offset, Euler, Scale), p, Retain);
            }
            unit.Release(Duration);
            return(true);
        }
Ejemplo n.º 3
0
    public Character AddActorLocalSync(XCharacter data)
    {
        if (data == null)
        {
            return(null);
        }
        GTTransform dTrans = GTTransform.Create(data.PosX, data.PosY, data.PosZ, data.Face);
        Character   cc     = AddActor(data.Id, (EBattleCamp)data.Camp, (EActorType)data.Type, dTrans, data, false);

        cc.Carrer        = data.Carrer;
        cc.IsRemoteActor = true;
        switch (cc.Type)
        {
        case EActorType.MONSTER:
            cc.EnableAI(true);
            cc.OnDeadFinish = () =>
            {
                if (cc != null && cc.CacheTransform != null)
                {
                    cc.CacheTransform.gameObject.SetActive(false);
                    GTEventCenter.FireEvent(GTEventID.TYPE_ACTOR_KILL_MONSTER, cc.GUID, cc.ID);
                    cc.OnDeadFinish = null;
                }
            };
            break;

        case EActorType.NPC:
            cc.EnableAI(true);
            break;
        }
        return(cc);
    }
Ejemplo n.º 4
0
        public override void Trigger()
        {
            base.Trigger();
            GTTransform data = GTTransform.Create(Pos, EulerAngles);

            m_EffectData = GTWorld.Instance.Ect.LoadEffect(EffectID, 0, data, null, false);
            m_EffectData.Release(EffectLifeTime);
        }
Ejemplo n.º 5
0
        IEnumerator DoSummon()
        {
            for (int i = 0; i < Count; i++)
            {
                yield return(new WaitForSeconds(Interval));

                Vector3     bornPoint = GTTools.RandomOnCircle(Skill.Caster.Pos, MinRadius, MaxRadius);
                Vector3     bornEuler = Vector3.zero;
                GTTransform kt        = GTTransform.Create(bornPoint, bornEuler);
                GTWorld.Instance.AddActor(Id, Skill.Caster.Camp, ActorType, kt, null, false);
            }
        }
Ejemplo n.º 6
0
    public Character AddActorSync(XCharacter data)
    {
        if (data == null)
        {
            return(null);
        }
        GTTransform dTrans = GTTransform.Create(data.PosX, data.PosY, data.PosZ, data.Face);
        Character   cc     = AddActor(data.Id, (EBattleCamp)data.Camp, (EActorType)data.Type, dTrans, data, false);

        cc.Carrer        = data.Carrer;
        cc.IsRemoteActor = true;
        return(cc);
    }
Ejemplo n.º 7
0
        protected override bool Trigger()
        {
            base.Trigger();
            GameObject go = GameObject.Find(ParentPath);

            if (go != null)
            {
                Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, GTTransform.Create(Offset, Euler, Scale), go.transform, Retain);
                Unit.Release(Duration);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 8
0
    public void TryStartMount()
    {
        XCharacter data = GTGlobal.Main;

        if (data.Mount == 0)
        {
            CharacterHelper.CalcCharacterOperateError(Resp.TYPE_RIDE_NONE);
            return;
        }
        if (GTLauncher.Instance.CurrCopyType != ECopyType.TYPE_CITY &&
            GTLauncher.Instance.CurrCopyType != ECopyType.TYPE_WORLD)
        {
            CharacterHelper.CalcCharacterOperateError(Resp.TYPE_RIDE_NOTDOATSCENE);
            return;
        }
        if (GTWorld.Main.IsFSMLayer2() || GTWorld.Main.IsFSMLayer3())
        {
            CharacterHelper.CalcCharacterOperateError(Resp.TYPE_RIDE_NOTDOATFSM);
            return;
        }
        if (GTWorld.Main.IsRide)
        {
            CharacterHelper.CalcCharacterOperateError(Resp.TYPE_RIDE_ING);
            return;
        }
        if (GTWorld.Main.FSM == FSMState.FSM_SKILL)
        {
            CharacterHelper.CalcCharacterOperateError(Resp.TYPE_SKILL_CASTING);
            return;
        }
        Vector3     pos      = GTWorld.Main.Pos;
        Vector3     euler    = GTWorld.Main.Euler;
        GTTransform bornData = GTTransform.Create(pos, euler);

        GTWorld.Main.Mount      = GTWorld.Instance.AddActor(data.Mount, EBattleCamp.CT_NONE, EActorType.MOUNT, bornData, null, false);
        GTWorld.Main.Mount.Host = GTWorld.Main;
        Resp resp = GTWorld.Main.Command.Get <CommandRideBegin>().Do();

        if (resp == Resp.TYPE_YES)
        {
            GTWorld.Main.PausedAI(true);
        }
        CharacterHelper.CalcCharacterOperateError(resp);
    }
Ejemplo n.º 9
0
 public override void Enter()
 {
     if (World)
     {
         Transform p = Carryer.Avatar.GetBindTransform(Bind);
         Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, Retain);
         Unit.CacheTransform.parent           = p;
         Unit.CacheTransform.localPosition    = Offset;
         Unit.CacheTransform.localEulerAngles = Euler;
         Unit.CacheTransform.parent           = null;
         Unit.CacheTransform.localScale       = Scale;
         Unit.CacheTransform.localEulerAngles = Euler + Carryer.Euler;
     }
     else
     {
         Transform p = Carryer.Avatar.GetBindTransform(Bind);
         Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, GTTransform.Create(Offset, Euler, Scale), p, Retain);
     }
 }
Ejemplo n.º 10
0
 void OnLoadAvatar()
 {
     if (WorldMap.MapData != null)
     {
         for (int i = 0; i < WorldMap.MapData.MapBorns.Count; i++)
         {
             MapBorn b = WorldMap.MapData.MapBorns[i];
             switch ((EBattleCamp)b.ID)
             {
             case EBattleCamp.CT_PVE_PLAYER:
                 GTTransform data = GTTransform.Create(b.Pos, b.Face);
                 AddMainPlayer(data);
                 GTCameraManager.Instance.CreateMainCamera(Main.CacheTransform);
                 GTCameraManager.Instance.CreateMiniCamera(Main.CacheFixEuler);
                 GTNetworkSend.Instance.TrySyncIdle();
                 break;
             }
         }
     }
 }
Ejemplo n.º 11
0
 public void Load(ActFlyObj obj, HitCallbackFly hitCallback)
 {
     mFlyObj = obj;
     if (obj.World)
     {
         Transform p = obj.Skill.Caster.Avatar.GetBindTransform(obj.CasterBind);
         mUnit = GTWorld.Instance.Ect.LoadEffect(obj.ID, 0, obj.Retain);
         mUnit.CacheTransform.parent           = p;
         mUnit.CacheTransform.localPosition    = obj.Offset;
         mUnit.CacheTransform.localEulerAngles = obj.Euler;
         mUnit.CacheTransform.parent           = null;
         mUnit.CacheTransform.localScale       = obj.Scale;
         mUnit.CacheTransform.localEulerAngles = obj.Euler + obj.Skill.Caster.Euler;
     }
     else
     {
         Transform p = obj.Skill.Caster.Avatar.GetBindTransform(obj.CasterBind);
         mUnit = GTWorld.Instance.Ect.LoadEffect(obj.ID, 0, GTTransform.Create(obj.Offset, obj.Euler, obj.Scale), p, obj.Retain);
     }
     mUnit.TriggerEnter = (other) => { hitCallback(this, other); };
     mIsLoaded          = true;
     CacheTransform     = mUnit.CacheTransform;
 }
Ejemplo n.º 12
0
        protected override bool Trigger()
        {
            Vector3    origin = Skill.Caster.Avatar.GetBindPosition(Bind);
            RaycastHit hit;

            if (Physics.Raycast(origin, Skill.Caster.Dir, out hit, MaxDis))
            {
                Collider col = hit.collider;
                if (HitEffectID > 0)
                {
                    EffectData unit = GTWorld.Instance.Ect.LoadEffect(HitEffectID, 0, GTTransform.Create(hit.point, Vector3.zero), null, true);
                    unit.Release(HitEffectDuration);
                }
                CharacterView view = col.GetComponent <CharacterView>();
                if (view != null)
                {
                    if (Skill.Caster.Match(Affect, view.Owner))
                    {
                        for (int i = 0; i < Children.Count; i++)
                        {
                            Children[i].ApplyHitPoint = hit.point;
                            Children[i].ApplyHitDir   = Vector3.up;
                            Children[i].ClearAttackList();
                            Children[i].AddInAttackList(view.Owner);
                        }
                        End();
                    }
                }
            }
            return(base.Trigger());
        }