コード例 #1
0
        protected override bool MakeResult(Character cc)
        {
            if (cc == null)
            {
                return(false);
            }
            EffectUnit 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, KTransform.Create(Offset, Euler, Scale), p, Retain);
            }
            unit.Release(Duration);
            return(true);
        }
コード例 #2
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, KTransform.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);
 }
コード例 #3
0
ファイル: LevelSystem.cs プロジェクト: wtrd1234/GameProject3
 IEnumerator AddNpc()
 {
     for (int i = 0; i < m_Config.Npcs.Count; i++)
     {
         LvlNpc data = m_Config.Npcs[i];
         CharacterManager.Instance.AddNpc(data.Id, KTransform.Create(data.Pos, data.Euler, data.Scale));
         yield return(null);
     }
 }
コード例 #4
0
    private void InitModel()
    {
        KTransform param  = KTransform.Create(Vector3.zero, Vector3.zero);
        Camera     camera = GTCameraManager.Instance.MainCamera;

        camera.transform.position    = new Vector3(0.2214f, 1.5794f, 41.2714f);
        camera.transform.eulerAngles = new Vector3(-23.7111f, -179.525f, 0.01245f);
        camera.fieldOfView           = 46.6f;
        camera.renderingPath         = RenderingPath.DeferredLighting;
    }
コード例 #5
0
ファイル: LevelSystem.cs プロジェクト: wtrd1234/GameProject3
 IEnumerator AddMonster()
 {
     for (int i = 0; i < m_Config.Monsters.Count; i++)
     {
         LvlMonster mm = m_Config.Monsters[i];
         KTransform bd = KTransform.Create(mm.Pos, mm.Euler);
         CharacterManager.Instance.AddMonster(mm.Id, bd);
         yield return(null);
     }
 }
コード例 #6
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;
                KTransform kt        = KTransform.Create(bornPoint, bornEuler);
                CharacterManager.Instance.AddActorNoneSync(Id, Skill.Caster.Camp, ActorType, kt);
            }
        }
コード例 #7
0
ファイル: LevelSystem.cs プロジェクト: wtrd1234/GameProject3
        IEnumerator AddMainPlayer()
        {
            int id = GTGlobal.CurPlayerID;

            if (m_Config.A == null)
            {
                yield break;
            }
            KTransform bornData = KTransform.Create(m_Config.A.Pos, m_Config.A.Euler);

            CharacterManager.Instance.AddMainPlayer(bornData);
            yield return(null);
        }
コード例 #8
0
        public IEnumerator   DoTriggerMonster(LevelMonster lm, Callback <Character> callback, float delay = 0)
        {
            Character cc = CharacterManager.Instance.AddMonster(lm.Id, KTransform.Create(lm.Pos, lm.Euler));

            if (cc != null)
            {
                callback(cc);
            }
            if (delay > 0)
            {
                yield return(new WaitForSeconds(delay));
            }
            yield return(null);
        }
コード例 #9
0
    public Character AddActorSync(XCharacter data)
    {
        if (data == null)
        {
            return(null);
        }
        if (data.AOI == null)
        {
            return(null);
        }
        KTransform dTrans = KTransform.Create(data.AOI);
        Character  cc     = AddActor(data.Id, (EBattleCamp)data.Camp, (EActorType)data.Type, dTrans, data, false);

        return(cc);
    }
コード例 #10
0
        protected override bool Trigger()
        {
            base.Trigger();
            GameObject go = GameObject.Find(ParentPath);

            if (go != null)
            {
                Unit = GTWorld.Instance.Ect.LoadEffect(ID, 0, KTransform.Create(Offset, Euler, Scale), go.transform, Retain);
                Unit.Release(Duration);
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #11
0
    private void OnAvatarStartMount()
    {
        XCharacter data = RoleModule.Instance.GetMainPlayer();

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

        CharacterManager.Main.Mount      = CharacterManager.Instance.AddActorNoneSync(data.Mount, EBattleCamp.D, EActorType.MOUNT, bornData);
        CharacterManager.Main.Mount.Host = CharacterManager.Main;
        Resp resp = CharacterManager.Main.Command.Get <CommandRideBegin>().Do();

        if (resp == Resp.TYPE_YES)
        {
            CharacterManager.Main.PausedAI(true);
        }
        CharacterHelper.CalcCharacterOperateError(resp);
    }
コード例 #12
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, KTransform.Create(Offset, Euler, Scale), p, Retain);
     }
 }
コード例 #13
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, KTransform.Create(obj.Offset, obj.Euler, obj.Scale), p, obj.Retain);
     }
     mUnit.TriggerEnter = (other) => { hitCallback(this, other); };
     mIsLoaded          = true;
     CacheTransform     = mUnit.CacheTransform;
 }
コード例 #14
0
ファイル: ActRay.cs プロジェクト: wtrd1234/GameProject3
        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)
                {
                    EffectUnit unit = GTWorld.Instance.Ect.LoadEffect(HitEffectID, 0, KTransform.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());
        }