Exemple #1
0
 public void destroyBullet(int bulletID)
 {
     if (!isMuzzle && dic.ContainsKey(bulletID))
     {
         ProjectileWrap projectileWrap = dic[bulletID];
         if (projectileWrap != null)
         {
             Object.DestroyImmediate(projectileWrap.projectile);
             dic.Remove(bulletID);
         }
     }
 }
Exemple #2
0
 public override void KaBoom(int projectile, Vector3 pos, Vector3 rot, bool viewColeff)
 {
     if (dic != null && dic.Count != 0)
     {
         if (Launcher == LAUNCHER.NONE)
         {
             if (!IsMuzzle && viewColeff && dic.ContainsKey(projectile))
             {
                 ProjectileWrap projectileWrap = dic[projectile];
                 if (!carryAnim && projectileWrap != null)
                 {
                     SelfCollsion component = projectileWrap.projectile.GetComponent <SelfCollsion>();
                     if (component != null)
                     {
                         component.Explosion(pos, projectileWrap.projectile.transform.rotation, myself: false);
                     }
                     Object.DestroyImmediate(projectileWrap.projectile);
                 }
                 if (misSmokeEff != null)
                 {
                     Object.DestroyImmediate(misSmokeEff);
                     misSmokeEff = null;
                 }
                 dic.Remove(projectile);
             }
         }
         else if (dic.ContainsKey(projectile))
         {
             Object.Instantiate((Object)GetExplosionEffByLauncher(), pos, Quaternion.Euler(rot));
             if (misSmokeEff != null)
             {
                 Object.DestroyImmediate(misSmokeEff);
                 misSmokeEff = null;
             }
             if (misObj != null)
             {
                 Object.DestroyImmediate(misObj);
                 misObj = null;
             }
             dic.Remove(projectile);
         }
     }
 }
Exemple #3
0
    public static void Bind(LuaState L)
    {
        float t = Time.realtimeSinceStartup;

        L.BeginModule(null);
        DebuggerWrap.Register(L);
        ActorWrap.Register(L);
        SkillWrap.Register(L);
        BuffWrap.Register(L);
        ProjectileWrap.Register(L);
        BattleControllerWrap.Register(L);
        BattleTimeWrap.Register(L);
        GameConfigWrap.Register(L);
        DamageTypeWrap.Register(L);
        RangeTypeWrap.Register(L);
        ProjectileTypeWrap.Register(L);
        TargetFlagWrap.Register(L);
        TeamFlagWrap.Register(L);
        StatusFlagWrap.Register(L);
        FindTypeWrap.Register(L);
        AttachTypeWrap.Register(L);
        ProjectileFormationWrap.Register(L);
        Singleton_BattleControllerWrap.Register(L);
        L.BeginModule("UnityEngine");
        UnityEngine_ComponentWrap.Register(L);
        UnityEngine_BehaviourWrap.Register(L);
        UnityEngine_MonoBehaviourWrap.Register(L);
        UnityEngine_GameObjectWrap.Register(L);
        UnityEngine_TransformWrap.Register(L);
        L.BeginModule("Events");
        L.RegFunction("UnityAction", UnityEngine_Events_UnityAction);
        L.EndModule();
        L.EndModule();
        L.BeginModule("System");
        L.RegFunction("Action", System_Action);
        L.RegFunction("Action_Actor", System_Action_Actor);
        L.RegFunction("Action_Skill", System_Action_Skill);
        L.RegFunction("Action_Projectile", System_Action_Projectile);
        L.EndModule();
        L.EndModule();
        Debugger.Log("Register lua type cost time: {0}", Time.realtimeSinceStartup - t);
    }
Exemple #4
0
 public void createBullet(Vector3 pnt, Vector3 nml, int brickSeq, int bulletId, int hitState)
 {
     if (!(bulletObj == null))
     {
         if (!isMuzzle)
         {
             if (dic.ContainsKey(bulletId))
             {
                 ProjectileWrap projectileWrap = dic[bulletId];
                 if (projectileWrap != null)
                 {
                     Object.DestroyImmediate(projectileWrap.projectile);
                     dic.Remove(bulletId);
                 }
             }
             if (!(bulletObj == null))
             {
                 GameObject gameObject = Object.Instantiate((Object)bulletObj) as GameObject;
                 gameObject.transform.position = pnt;
                 gameObject.transform.forward  = nml;
                 if (brickSeq >= 0 && hitState == 1)
                 {
                     CheckBrickDead component = gameObject.GetComponent <CheckBrickDead>();
                     component.brickID = brickSeq;
                 }
                 if (brickSeq >= 0 && hitState == 2)
                 {
                     CheckMonDead component2 = gameObject.GetComponent <CheckMonDead>();
                     component2.MonID = brickSeq;
                 }
                 if (hitState == 0 || hitState == 2)
                 {
                     ParentFollow component3 = gameObject.GetComponent <ParentFollow>();
                     if (component3 != null)
                     {
                         component3.HitParent            = GlobalVars.Instance.hitParent;
                         component3.ParentSeq            = GlobalVars.Instance.hitBirckman;
                         GlobalVars.Instance.hitParent   = null;
                         GlobalVars.Instance.hitBirckman = -1;
                     }
                 }
             }
         }
         else
         {
             GameObject gameObject2 = Object.Instantiate((Object)bulletObj) as GameObject;
             gameObject2.transform.position = pnt;
             gameObject2.transform.forward  = nml;
             if (brickSeq >= 0 && hitState == 1)
             {
                 CheckBrickDead component4 = gameObject2.GetComponent <CheckBrickDead>();
                 component4.brickID = brickSeq;
             }
             if (brickSeq >= 0 && hitState == 2)
             {
                 CheckMonDead component5 = gameObject2.GetComponent <CheckMonDead>();
                 component5.MonID = brickSeq;
             }
             if (hitState == 0 || hitState == 2)
             {
                 ParentFollow component6 = gameObject2.GetComponent <ParentFollow>();
                 if (component6 != null)
                 {
                     component6.HitParent            = GlobalVars.Instance.hitParent;
                     component6.ParentSeq            = GlobalVars.Instance.hitBirckman;
                     GlobalVars.Instance.hitParent   = null;
                     GlobalVars.Instance.hitBirckman = -1;
                 }
             }
         }
     }
 }