Esempio n. 1
0
    static int GotoAndStopByProgress(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                DragonBones.AnimationState o = obj.GotoAndStopByProgress(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                DragonBones.AnimationState o = obj.GotoAndStopByProgress(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.Animation.GotoAndStopByProgress"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 2
0
 static int FadeIn(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 11);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject(L, 1, typeof(DragonBones.Animation));
         string arg0 = ToLua.CheckString(L, 2);
         float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
         int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
         string arg4 = ToLua.CheckString(L, 6);
         DragonBones.AnimationFadeOutMode arg5 = (DragonBones.AnimationFadeOutMode)ToLua.CheckObject(L, 7, typeof(DragonBones.AnimationFadeOutMode));
         bool arg6 = LuaDLL.luaL_checkboolean(L, 8);
         bool arg7 = LuaDLL.luaL_checkboolean(L, 9);
         bool arg8 = LuaDLL.luaL_checkboolean(L, 10);
         bool arg9 = LuaDLL.luaL_checkboolean(L, 11);
         DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 3
0
    static IEnumerator DealTicketResult(long num, float showTime = 3f)
    {
        ticketResultObj.SetActive(true);

        Transform tfm = ticketResultObj.transform.Find("ImageBG/Image_TicketFrame/Text_Ticket");

        tfm.GetComponent <Text>().text = "x" + num.ToString();


        tfm = ticketResultObj.transform.Find("ImageBG/Text/Anime_Ticket_1");
        tfm.gameObject.SetActive(true);

        Transform tfm1 = ticketResultObj.transform.Find("ImageBG/Text/Anime_Ticket_2");

        tfm1.gameObject.SetActive(false);

        DragonBones.Animation anim = tfm.GetComponent <DragonBones.UnityArmatureComponent>().animation;
        anim.Play();

        yield return(new WaitUntil(() => anim.isCompleted));

        tfm.gameObject.SetActive(false);
        tfm1.gameObject.SetActive(true);

        anim = tfm1.GetComponent <DragonBones.UnityArmatureComponent>().animation;
        anim.Play();

        yield return(new WaitForSecondsRealtime(showTime));

        ticketResultObj.SetActive(false);
    }
Esempio n. 4
0
    static int Stop(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                obj.Stop();
                return(0);
            }
            else if (count == 2)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                obj.Stop(arg0);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.Animation.Stop"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 5
0
    // ==================================================



    // ==================================================
    // Private functions
    // ==================================================
    private void Start()
    {
        animation = transform.GetChild(0).gameObject.GetComponent <DragonBones.UnityArmatureComponent>().animation;

        x = SECURITY_START_X;
        y = SECURITY_START_Y;
        transform.position   = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y, transform.position.z);
        transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE * direction, SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE, SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE);

        bossScript = SCR_Gameplay.instance.boss.GetComponent <SCR_Boss>();

        shadow = Instantiate(PFB_Shadow);
        shadow.transform.position   = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y + SECURITY_SHADOW_OFFSET, shadow.transform.position.z);
        shadow.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE * (-direction), SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE, SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE);

        trail = Instantiate(PFB_Trail);
        trail.GetComponent <SCR_Trail>().TurnParticleOff();

        landParticle = Instantiate(PFB_Land);
        landParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE, SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE, SCR_Gameplay.SCREEN_SCALE * SECURITY_SCALE);
        landParticle.SetActive(false);

        punchParticle = Instantiate(PFB_PunchParticle);
        punchParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE);
        foreach (Transform child in punchParticle.transform)
        {
            child.gameObject.SetActive(false);
        }

        SwitchState(SecurityState.STAND);
    }
Esempio n. 6
0
        private IEnumerator DoWatchAnimation(DragonBones.Animation animation, UnityAction onComplete)
        {
            while (!animation.isCompleted)
            {
                yield return(null);
            }

            if (onComplete != null)
            {
                onComplete();
            }

            yield break;
        }
Esempio n. 7
0
        private IEnumerator Animate(KeyFrame frame)
        {
            float         elapsed       = 0;
            GameObject    go            = gos[frame.name];
            RectTransform rectTransform = dialogs[frame.name].GetComponent <RectTransform>();

            if (IS_3D_MODE)
            {
                // 改变动画状态机的状态
                Animator animator = go.GetComponent <Animator>();
                animator.SetTrigger(frame.name);
            }
            else
            {
                // 播放 DrangonBones 动画
                UnityArmatureComponent             armatureComp = go.GetComponent <UnityArmatureComponent>();
                DragonBones.Animation              animation    = armatureComp.animation;
                Dictionary <string, AnimationData> animations   = animation.animations;
                float length = animations[frame.content].duration;
                if (frame.loop > 0)
                {
                    animation.timeScale = length / (frame.duration / frame.loop);
                }
                else
                {
                    animation.timeScale = 1;
                }
                animation.Play(frame.content, frame.loop);
            }

            // 插值改变物体 transform
            UnityEngine.Transform transform = go.transform;
            transform.SetPositionAndRotation(frame.StartPosition, frame.StartRotation);
            transform.localScale = frame.StartScale;

            while (elapsed < frame.duration)
            {
                transform.SetPositionAndRotation(
                    LerpUtility.Linear(frame.StartPosition, frame.EndPosition, elapsed / frame.duration),
                    LerpUtility.Linear(frame.StartRotation, frame.EndRotation, elapsed / frame.duration)
                    );
                transform.localScale = LerpUtility.Linear(frame.StartScale, frame.EndScale, elapsed / frame.duration);
                if (!IS_3D_MODE)
                {
                    UpdateDialogPos(transform.position, rectTransform);
                }
                elapsed += Time.deltaTime;
                yield return(new WaitForEndOfFrame());
            }
        }
Esempio n. 8
0
 static int Reset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
         obj.Reset();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 9
0
 static int GetStates(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
         System.Collections.Generic.List <DragonBones.AnimationState> o = obj.GetStates();
         ToLua.PushSealed(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 10
0
 static int Stop(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject(L, 1, typeof(DragonBones.Animation));
         string arg0 = ToLua.CheckString(L, 2);
         obj.Stop(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 11
0
    // ==================================================



    // ==================================================
    // Private functions
    // ==================================================
    private void Start()
    {
        animation = transform.GetChild(0).gameObject.GetComponent <DragonBones.UnityArmatureComponent>().animation;

        x = PLAYER_START_X;
        y = PLAYER_START_Y;
        transform.position   = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y, transform.position.z);
        transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * PLAYER_SCALE * (-direction), SCR_Gameplay.SCREEN_SCALE * PLAYER_SCALE, SCR_Gameplay.SCREEN_SCALE * PLAYER_SCALE);

        bossScript     = SCR_Gameplay.instance.boss.GetComponent <SCR_Boss>();
        securityScript = SCR_Gameplay.instance.security.GetComponent <SCR_Security>();

        target = Instantiate(PFB_Target);
        target.SetActive(false);

        shadow = Instantiate(PFB_Shadow);
        shadow.transform.position   = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y + PLAYER_SHADOW_OFFSET, shadow.transform.position.z);
        shadow.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * PLAYER_SHADOW_SCALE * (-direction), SCR_Gameplay.SCREEN_SCALE * PLAYER_SHADOW_SCALE, SCR_Gameplay.SCREEN_SCALE * PLAYER_SHADOW_SCALE);

        marker = Instantiate(PFB_Marker);
        marker.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * PLAYER_MARKER_SCALE, SCR_Gameplay.SCREEN_SCALE * PLAYER_MARKER_SCALE, SCR_Gameplay.SCREEN_SCALE * PLAYER_MARKER_SCALE);
        marker.SetActive(false);

        landParticle = Instantiate(PFB_Land);
        landParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * PLAYER_SMOKE_SCALE, SCR_Gameplay.SCREEN_SCALE * PLAYER_SMOKE_SCALE, SCR_Gameplay.SCREEN_SCALE * PLAYER_SMOKE_SCALE);
        landParticle.SetActive(false);

        chargeCount = 0;

        trail = Instantiate(PFB_Trail);
        trail.GetComponent <SCR_Trail>().TurnParticleOff();

        punchParticle = Instantiate(PFB_PunchParticle);
        punchParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE);
        foreach (Transform child in punchParticle.transform)
        {
            child.gameObject.SetActive(false);
        }

        tearParticle = Instantiate(PFB_ClothTear);
        tearParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE);
        foreach (Transform child in tearParticle.transform)
        {
            child.gameObject.SetActive(false);
        }

        SwitchState(PlayerState.TALK);
    }
Esempio n. 12
0
 static int GetState(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         DragonBones.AnimationState o = obj.GetState(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 13
0
 static int PlayConfig(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.Animation       obj  = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
         DragonBones.AnimationConfig arg0 = (DragonBones.AnimationConfig)ToLua.CheckObject <DragonBones.AnimationConfig>(L, 2);
         DragonBones.AnimationState  o    = obj.PlayConfig(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 14
0
 static int HasAnimation(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         bool   o    = obj.HasAnimation(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 15
0
    static int get_timeScale(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            float ret = obj.timeScale;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index timeScale on a nil value"));
        }
    }
Esempio n. 16
0
 static int GotoAndStopByProgress(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject(L, 1, typeof(DragonBones.Animation));
         string arg0 = ToLua.CheckString(L, 2);
         float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
         DragonBones.AnimationState o = obj.GotoAndStopByProgress(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 17
0
    static int get_isPlaying(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            bool ret = obj.isPlaying;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index isPlaying on a nil value" : e.Message));
        }
    }
Esempio n. 18
0
    static int get_lastAnimationName(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            string ret = obj.lastAnimationName;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index lastAnimationName on a nil value" : e.Message));
        }
    }
Esempio n. 19
0
    static int get_isCompleted(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            bool ret = obj.isCompleted;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index isCompleted on a nil value"));
        }
    }
Esempio n. 20
0
    static int set_animations(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            System.Collections.Generic.Dictionary <string, DragonBones.AnimationData> arg0 = (System.Collections.Generic.Dictionary <string, DragonBones.AnimationData>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.Dictionary <string, DragonBones.AnimationData>));
            obj.animations = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index animations on a nil value"));
        }
    }
Esempio n. 21
0
    static int get_animationNames(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            System.Collections.Generic.List <string> ret = obj.animationNames;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index animationNames on a nil value" : e.Message));
        }
    }
    static int get_animation(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.UnityArmatureComponent obj = (DragonBones.UnityArmatureComponent)o;
            DragonBones.Animation ret = obj.animation;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index animation on a nil value"));
        }
    }
Esempio n. 23
0
    static int get_animation(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Armature  obj = (DragonBones.Armature)o;
            DragonBones.Animation ret = obj.animation;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index animation on a nil value" : e.Message));
        }
    }
Esempio n. 24
0
    static int set_timeScale(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            float arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.timeScale = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index timeScale on a nil value"));
        }
    }
Esempio n. 25
0
    static int get_lastAnimationState(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation      obj = (DragonBones.Animation)o;
            DragonBones.AnimationState ret = obj.lastAnimationState;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index lastAnimationState on a nil value"));
        }
    }
Esempio n. 26
0
    static int get_animations(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.Animation obj = (DragonBones.Animation)o;
            System.Collections.Generic.Dictionary <string, DragonBones.AnimationData> ret = obj.animations;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index animations on a nil value"));
        }
    }
Esempio n. 27
0
 static int GotoAndPlayByFrame(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject(L, 1, typeof(DragonBones.Animation));
         string arg0 = ToLua.CheckString(L, 2);
         uint   arg1 = (uint)LuaDLL.luaL_checknumber(L, 3);
         int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
         DragonBones.AnimationState o = obj.GotoAndPlayByFrame(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 28
0
    static int _CreateDragonBones_Animation(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                DragonBones.Animation obj = new DragonBones.Animation();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: DragonBones.Animation.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 29
0
    /*
     * public  string[]	resultTitle;
     * public  int[]		resultTitleFontSize;
     */
    // ==================================================



    // ==================================================
    // Private functions
    // ==================================================
    private void Start()
    {
        /*
         * resultTitle = new string[(int)BossType.BOSS_COUNT];
         * resultTitle[(int)BossType.THE_BOSS]		= "Your Boss";
         * resultTitle[(int)BossType.THE_DICTATOR]	= "The dictator";
         * resultTitle[(int)BossType.MR_PRESIDENT]	= "Mr President";
         * resultTitle[(int)BossType.THE_GENERAL]	= "The general";
         * resultTitle[(int)BossType.ERIX_LUKE]	= "Erix Luke";
         *
         * resultTitleFontSize = new int[(int)BossType.BOSS_COUNT];
         * resultTitleFontSize[(int)BossType.THE_BOSS]		= 155;
         * resultTitleFontSize[(int)BossType.THE_DICTATOR]	= 120;
         * resultTitleFontSize[(int)BossType.MR_PRESIDENT]	= 120;
         * resultTitleFontSize[(int)BossType.THE_GENERAL]	= 130;
         * resultTitleFontSize[(int)BossType.ERIX_LUKE]	= 150;
         */

        dialogues = new string[(int)BossType.BOSS_COUNT][];

        dialogues[(int)BossType.THE_BOSS] = new string[]
        { "It's the 3rd time you're late!"
          , "You're such a slow worker!"
          , "You'll never be promoted!"
          , "One more mistake and you're fired!"
          , "Why are you so lazy?"
          , "You'll OT this weekend, alone!"
          , "Don't even ask for a raise."
          , "You working result is pathetic..."
          , "You should feel ashamed." };

        dialogues[(int)BossType.THE_DICTATOR] = new string[]
        { "It's the 3rd time you're late!"
          , "You're such a slow worker!"
          , "You'll never be promoted!"
          , "One more mistake and you're fired!"
          , "Why are you so lazy?"
          , "You'll OT this weekend, alone!"
          , "Don't even ask for a raise."
          , "You working result is pathetic..."
          , "You should feel ashamed." };

        dialogues[(int)BossType.MR_PRESIDENT] = new string[]
        { "It's the 3rd time you're late!"
          , "You're such a slow worker!"
          , "You'll never be promoted!"
          , "One more mistake and you're fired!"
          , "Why are you so lazy?"
          , "You'll OT this weekend, alone!"
          , "Don't even ask for a raise."
          , "You working result is pathetic..."
          , "You should feel ashamed." };

        dialogues[(int)BossType.THE_GENERAL] = new string[]
        { "It's the 3rd time you're late!"
          , "You're such a slow worker!"
          , "You'll never be promoted!"
          , "One more mistake and you're fired!"
          , "Why are you so lazy?"
          , "You'll OT this weekend, alone!"
          , "Don't even ask for a raise."
          , "You working result is pathetic..."
          , "You should feel ashamed." };

        dialogues[(int)BossType.ERIX_LUKE] = new string[]
        { "It's the 3rd time you're late!"
          , "You're such a slow worker!"
          , "You'll never be promoted!"
          , "One more mistake and you're fired!"
          , "Why are you so lazy?"
          , "You'll OT this weekend, alone!"
          , "Don't even ask for a raise."
          , "You working result is pathetic..."
          , "You should feel ashamed." };

        dialogue = dialogues[(int)bossType];
        System.Array.Sort(dialogue, RandomSort);

        animation = transform.GetChild(0).gameObject.GetComponent <DragonBones.UnityArmatureComponent>().animation;

        x = BOSS_START_X;
        y = BOSS_START_Y;

        originalScale = new Vector3(
            SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE,
            SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE,
            1);

        currentScale = originalScale;

        transform.position   = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y, transform.position.z);
        transform.localScale = new Vector3(currentScale.x * (-direction), currentScale.y, currentScale.z);

        shadow = Instantiate(PFB_Shadow);
        shadow.transform.position   = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y + BOSS_SHADOW_OFFSET, shadow.transform.position.z);
        shadow.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE * (-direction), SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE);

        for (int i = 0; i < 6; i++)
        {
            moneyParticle[i] = Instantiate(PFB_MoneyEffect[i % 3]);
            moneyParticle[i].transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE);
            moneyParticle[i].SetActive(false);
        }

        moneyBagParticle = Instantiate(PFB_MoneyBagEffect);
        moneyBagParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE);
        moneyBagParticle.SetActive(false);

        smokeParticle = Instantiate(PFB_Smoke);
        smokeParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE);
        ParticleSystem.EmissionModule emission = smokeParticle.GetComponent <ParticleSystem>().emission;
        emission.rateOverTime = 0;

        landParticle = Instantiate(PFB_Land);
        landParticle.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE);
        landParticle.SetActive(false);

        talkBubble = Instantiate(PFB_TalkBubble);
        talkBubble.transform.localScale    = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_TALK_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_TALK_SCALE, 1);
        talkBubble.transform.localPosition = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x + BOSS_TALK_OFFSET_X, y + BOSS_TALK_OFFSET_Y, talkBubble.transform.localPosition.z);
        talkBubble.SetActive(false);

        bubble  = Instantiate(PFB_Bubble);
        attract = Instantiate(PFB_Attract);

        atmosBurn = Instantiate(PFB_AtmosBurn);
        atmosBurn.transform.localScale    = new Vector3(SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE, 1);
        atmosBurn.transform.localPosition = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x + BOSS_BURN_OFFSET_X, y + BOSS_BURN_OFFSET_Y, atmosBurn.transform.localPosition.z);
        atmosBurn.SetActive(false);

        bossName = Instantiate(PFB_BossName);
        bossName.transform.localScale    = new Vector3(SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE, 1);
        bossName.transform.localPosition = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f + x, y + BOSS_NAME_OFFSET_Y, bossName.transform.localPosition.z);
        bossName.transform.GetChild(0).GetChild(0).gameObject.GetComponent <Text>().text = SCR_Profile.bosses[SCR_Profile.bossSelecting].name;
        //bossName.SetActive (false);

        tutorialTarget = Instantiate(PFB_TutorialTarget);
        tutorialTarget.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, SCR_Gameplay.SCREEN_SCALE * BOSS_SCALE, 1);
        tutorialTarget.SetActive(false);

        tutorialFinger = Instantiate(PFB_TutorialFinger);
        tutorialFinger.transform.localScale = new Vector3(SCR_Gameplay.SCREEN_SCALE, SCR_Gameplay.SCREEN_SCALE, 1);
        tutorialFinger.SetActive(false);


        if (SCR_Profile.showTutorial == 1)
        {
            tutorialFinger.transform.localPosition = new Vector3(SCR_Gameplay.SCREEN_W * 0.5f, SCR_Gameplay.SCREEN_H * 0.7f, tutorialTarget.transform.localPosition.z);
            tutorialFinger.SetActive(true);
        }

        rotation = 0;

        material = GetComponentInChildren <MeshRenderer>().sharedMaterial;
        material.SetFloat("_FlashAmount", 0);

        SwitchState(BossState.TALK);
    }
Esempio n. 30
0
    static int FadeIn(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                DragonBones.AnimationState o = obj.FadeIn(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 5)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2, arg3);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 6)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                string arg4 = ToLua.CheckString(L, 6);
                DragonBones.AnimationState o = obj.FadeIn(arg0, arg1, arg2, arg3, arg4);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 7)
            {
                DragonBones.Animation obj = (DragonBones.Animation)ToLua.CheckObject <DragonBones.Animation>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                float  arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                int    arg2 = (int)LuaDLL.luaL_checknumber(L, 4);
                int    arg3 = (int)LuaDLL.luaL_checknumber(L, 5);
                string arg4 = ToLua.CheckString(L, 6);
                DragonBones.AnimationFadeOutMode arg5 = (DragonBones.AnimationFadeOutMode)ToLua.CheckObject(L, 7, typeof(DragonBones.AnimationFadeOutMode));
                DragonBones.AnimationState       o    = obj.FadeIn(arg0, arg1, arg2, arg3, arg4, arg5);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.Animation.FadeIn"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }