示例#1
0
 // Use this for initialization
 void Start()
 {
     //設定BoneAnimation
     this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
     this.boneAnimation.RegisterColliderTriggerDelegate(RootHit);
     this.boneAnimation.RegisterUserTriggerDelegate(AttackDestroy);
 }
示例#2
0
    IEnumerator cheatAniPlay(string no)
    {
        SmoothMoves.BoneAnimation boneAni = gameObject.GetComponent <SmoothMoves.BoneAnimation>();

        if (string.IsNullOrEmpty(no) == true)
        {
            string aniName = boneAni.GetAnimationClipName(0);
            no = aniName.Split('_') [1];
        }
        string ani = "Atk_" + no;
        int    i   = boneAni.GetAnimationClipIndex(ani);

        if (i == -1)
        {
            yield break;
        }

        if (boneAni.IsPlaying(ani) == true)
        {
            boneAni.Stop();
        }

        Debug.Log(boneAni[ani].length);

        boneAni.CrossFade(ani);

        yield return(new WaitForSeconds(boneAni[ani].length));

        if (boneAni != null)
        {
            boneAni.CrossFade("Idle_" + no);
        }
    }
示例#3
0
 /// <summary>
 /// 開啟當前階段的提示
 /// </summary>
 /// <param name="currentStage">目前進行階段</param>
 public void ShowStageHint(DrawStage currentStage)
 {
     this.currentStageHintObject = (GameObject)Instantiate(this.StageHintObject);
     SmoothMoves.BoneAnimation boneAnimation = this.currentStageHintObject.GetComponent <SmoothMoves.BoneAnimation>();
     boneAnimation.playAutomatically = false;
     boneAnimation.Play(currentStage.ToString());
 }
示例#4
0
    IEnumerator cheatAniPlay(string no)
    {
        SmoothMoves.BoneAnimation boneAni = gameObject.GetComponent <SmoothMoves.BoneAnimation>();

        string ani = "Atk_" + no;
        int    i   = boneAni.GetAnimationClipIndex(ani);

        if (i == -1)
        {
            yield break;
        }

        if (boneAni.IsPlaying(ani) == true)
        {
            boneAni.Stop();
        }



        boneAni.CrossFade(ani);

        yield return(new WaitForSeconds(boneAni[ani].length));

        if (boneAni != null)
        {
            boneAni.CrossFade("Idle_" + no);
        }
    }
示例#5
0
 void Start()
 {
     if (string.IsNullOrEmpty(no) == true)
     {
         SmoothMoves.BoneAnimation boneAni = gameObject.GetComponent <SmoothMoves.BoneAnimation>();
         string aniName = boneAni.GetAnimationClipName(0);
         no = _no = aniName.Split('_') [1];
     }
 }
    // Use this for initialization
    void Start()
    {
        //載入敵人資訊
        this.enemyInfo = this.GetComponent<EnemyPropertyInfo>();

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        GameManager.script.RegisterBoneAnimation(this.boneAnimation);   //註冊BoneAnimation,GameManager統一管理
    }
示例#7
0
    // Use this for initialization
    void Start()
    {
        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(FlowerCloseDestroy);

        this.boneAnimation.playAutomatically = false;
        this.boneAnimation.Play("FlowerOpen");
    }
示例#8
0
 void Start()
 {
     if (string.IsNullOrEmpty(no) == true)
     {
         SmoothMoves.BoneAnimation boneAni = gameObject.GetComponent <SmoothMoves.BoneAnimation>();
         string aniName = boneAni.GetAnimationClipName(0);
         no = _no = aniName.Split('_') [1];
         ChangeNo(changeTo);
         StartCoroutine("cheatAniPlay", no);
     }
 }
示例#9
0
    // Use this for initialization
    void Start()
    {
        this.isDisappear = false;

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(DisappearDestroy);

        //讀取系統儲存的障礙物屬性資料
        GameDefinition.ObstacleData getData = GameDefinition.ObstacleList.Find((GameDefinition.ObstacleData data) => { return data.ObstacleName == Obstacle; });
        this.Damage = getData.Damage;
    }
示例#10
0
    /// <summary>
    /// 恢復所有註冊的BoneAnimation
    /// </summary>
    public void ResumeAllBoneAnimation()
    {
        lock (this.AllBoneAnimationList)
        {
            //從AllBoneAnimation 複製到local arrays
            SmoothMoves.BoneAnimation[] allAnimations = new SmoothMoves.BoneAnimation[this.AllBoneAnimationList.Keys.Count];
            this.AllBoneAnimationList.Keys.CopyTo(allAnimations, 0);

            for (int i = 0; i < allAnimations.Length; i++)
            {
                this.AllBoneAnimationList[allAnimations[i]] = true;    //將狀態改為正在使用
            }
        }
    }
示例#11
0
    /// <summary>
    /// 切換作畫階段
    /// </summary>
    /// <param name="nextStage">下一階段</param>
    public void ChangeDrawStage(DrawStage nextStage)
    {
        if (nextStage == DrawStage.等待中)
        {
            return;
        }

        if (this.currentStageHintObject != null)
        {
            Destroy(this.currentStageHintObject);
        }

        this.物件區背景.SetActive(false);

        if (nextStage == DrawStage.寄信)
        {
            this.CurrentDrawStage = DrawStage.等待中;
            this.現代郎世寧.SetActive(false);        //將左上"現代郎世寧"關閉
            this.截圖使用物件.SetActive(true);        //開啟"截圖使用物件"
            State.script.光源的控制桿.SetActive(false);
            ScreenShot.script.RunScreenCapture();
            return;
        }
        else if (nextStage == DrawStage.簽名)
        {
            this.CurrentDrawStage = DrawStage.簽名;
            this.現代郎世寧.SetActive(false);        //將左上"現代郎世寧"關閉
            this.截圖使用物件.SetActive(true);        //開啟"截圖使用物件"
            State.script.光源的控制桿.SetActive(false);
            this.簽名物件.SetActive(true);
            return;
        }

        GameObject obj = (GameObject)Instantiate(this.TitleShowObject);

        SmoothMoves.BoneAnimation boneAnimation = obj.GetComponent <SmoothMoves.BoneAnimation>();
        boneAnimation.playAutomatically = false;
        boneAnimation.Play(nextStage.ToString());

        //開頭動畫狀態進行觸碰事件偵測
        if (nextStage == DrawStage.開頭動畫)
        {
            this.CurrentDrawStage = DrawStage.開頭動畫;
        }
        else
        {
            this.CurrentDrawStage = DrawStage.等待中;
        }
    }
示例#12
0
    void ChangeNo(int plus)
    {
        SmoothMoves.BoneAnimation boneAni = gameObject.GetComponent <SmoothMoves.BoneAnimation> ();
        string aniName = gameObject.name;

        //print (aniName);
        string[] arr = aniName.Split('_');
        if (arr.Length >= 3)
        {
            int n2;
            int.TryParse(arr[2], out n2);
            int n1;
            int.TryParse(arr[1], out n1);
            if (n2 - n1 >= plus)
            {
                int n;
                int.TryParse(_no, out n);
                no = (n + plus).ToString().PadLeft(4, '0');
                boneAni.Stop();
                //StopCoroutine ("cheatAniPlay");
                //StartCoroutine ("cheatAniPlay", no);
            }
        }
    }
示例#13
0
    // Use this for initialization
    void Start()
    {
        this.isWeak = false;
        this.CurrentEnergy = 0;     //當前能量初始化為0
        this.MaxEnergy = 1000;      //能量值上限1000

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();

        //讀取系統儲存的角色屬性資料
        GameDefinition.RoleData getData = GameDefinition.RoleList.Find((GameDefinition.RoleData data) => { return data.RoleName == Role; });
        this.maxLife = getData.Life;
        this.currentLife = getData.Life;
        this.damage = getData.Damage;
        this.defence = getData.Defence;
        this.AttackRatioAdd = getData.AttackRatioAdd;
        this.AttackLV = PlayerPrefsDictionary.script.GetValue(LevelSystem.script.RoleNameDictionary[this.Role] + "_BASIC_LV");
        this.UltimateSkillLV = PlayerPrefsDictionary.script.GetValue(LevelSystem.script.RoleNameDictionary[this.Role] + "_ULT_LV");

        this.cureRate = this.maxLife / 300;

        InvokeRepeating("RestoreLifePersecond", 0.1f, 1);       //每秒固定回復生命值
        InvokeRepeating("RestoreEnergyPersecond", 0.1f, 1);     //每秒固定回復能量值
    }
示例#14
0
    /// <summary>
    /// 暫停所有註冊的BoneAnimation (去除參數的BoneAnimation)
    /// </summary>
    /// <param name="dontStopAnimation">不暫停的BoneAnimation</param>
    public void StopAllBoneAnimation(SmoothMoves.BoneAnimation dontStopAnimation = null)
    {
        lock (this.AllBoneAnimationList)
        {
            //從List 複製到local arrays
            SmoothMoves.BoneAnimation[] allAnimations = new SmoothMoves.BoneAnimation[this.AllBoneAnimationList.Keys.Count];
            this.AllBoneAnimationList.Keys.CopyTo(allAnimations, 0);
            List<SmoothMoves.BoneAnimation> animationList = new List<SmoothMoves.BoneAnimation>(allAnimations);

            //去除不必暫停物件
            if (dontStopAnimation != null)
                animationList.Remove(dontStopAnimation);

            for (int i = 0; i < animationList.Count; i++)
            {
                animationList[i].Stop();    //暫停BoneAnimation的運作
                this.AllBoneAnimationList[animationList[i]] = false;    //將狀態改為停止
            }
        }
    }
示例#15
0
 void Start()
 {
     script        = this;
     boneAnimation = this.GetComponent <SmoothMoves.BoneAnimation>();
     boneAnimation.playAutomatically = false;
 }
示例#16
0
 // Use this for initialization
 void Start()
 {
     //設定BoneAnimation
     this.boneAnimation = this.GetComponent <SmoothMoves.BoneAnimation>();
     this.boneAnimation.RegisterUserTriggerDelegate(this.AutoDestroy);
 }
    // Use this for initialization
    void Start()
    {
        script = this;

        //載入敵人資訊
        this.bossInfo = this.GetComponent<BossPropertyInfo>();

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(UserTrigger);
        GameManager.script.RegisterBoneAnimation(this.boneAnimation);   //註冊BoneAnimation,GameManager統一管理

        this.boneAnimation.playAutomatically = false;
        this.boneAnimation.Play("nowake");
        this.currentBossAction = BossAction.未甦醒;

        this.currentOpenFlowerCount = 0;    //目前開出花朵的數目設定為0
        this.addDamageValue = 0;            //累積的傷害值設定為0
        this.ActionTimer.ChangeTimerState(false);                   //關閉計時器功能
        this.currentAttackProbability = this.minAttackProbability;  //當前觸發樹根攻擊的機率為最小機率
        this.currentAddFlowerOpenTime = this.ActionTimer.花朵生成時間;
        this.NextActionTime = this.ActionTimer.觸發小樹根間隔時間;
    }
示例#18
0
    // Use this for initialization
    void Start()
    {
        this.isExplosion = false;

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(ExplosionDestroy);
    }
示例#19
0
    // Use this for initialization
    void Start()
    {
        this.isDead = false;

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(DeadDestroy);
        //如CurrentMaterial有值,則設定當前物件Material
        if (this.CurrentMaterial != null)
        {
            this.boneAnimation.RestoreOriginalMaterials();
            this.boneAnimation.SwapMaterial(this.boneAnimation.mMaterialSource[0], this.CurrentMaterial);
        }

        //讀取系統儲存的BOSS屬性資料
        if (this.Boss != GameDefinition.Boss.自訂Boss)  //如是"自訂"BOSS,則不讀取系統資料
        {
            GameDefinition.BossData getData = GameDefinition.BossList.Find((GameDefinition.BossData data) => { return data.BossName == Boss; });
            this.maxLife = getData.Life;
            this.currentLife = getData.Life;
            this.defence = getData.Defence;
            this.coin = getData.Coin;
            this.skillData = getData.SkillData;
        }
    }
示例#20
0
    // Use this for initialization
    void Start()
    {
        //載入敵人資訊
        this.enemyInfo = this.GetComponent<EnemyPropertyInfo>();

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterColliderTriggerDelegate(WeaponHit);
        this.boneAnimation.RegisterUserTriggerDelegate(ShootEvent);
        GameManager.script.RegisterBoneAnimation(this.boneAnimation);   //註冊BoneAnimation,GameManager統一管理
    }
示例#21
0
 void Start()
 {
     script = this;
     boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
     boneAnimation.playAutomatically = false;
 }
示例#22
0
    // Use this for initialization
    void Start()
    {
        this.isDead = false;

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(DeadDestroy);
        //如CurrentMaterial有值,則設定當前物件Material
        if (this.CurrentMaterial != null)
        {
            this.boneAnimation.RestoreOriginalMaterials();
            this.boneAnimation.SwapMaterial(this.boneAnimation.mMaterialSource[0], this.CurrentMaterial);
        }

        //讀取系統儲存的怪物屬性資料
        if (this.Enemy != GameDefinition.Enemy.自訂)  //如是"自訂"怪物,則不讀取系統資料
        {
            GameDefinition.EnemyData getData = GameDefinition.EnemyList.Find((GameDefinition.EnemyData data) => { return data.EnemyName == Enemy; });
            this.maxLife = getData.Life;
            this.currentLife = getData.Life;
            this.damage = getData.Damage;
            this.defence = getData.Defence;
            this.coin = getData.Coin;
        }
    }
 // Use this for initialization
 void Start()
 {
     //設定BoneAnimation
     this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
     this.boneAnimation.RegisterUserTriggerDelegate(this.AutoDestroy);
 }
 // Use this for initialization
 void Start()
 {
     //設定BoneAnimation
     this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
     this.boneAnimation.RegisterUserTriggerDelegate(AnimationEventFunction);
 }
示例#25
0
 // Use this for initialization
 void Start()
 {
     bom = this.GetComponent<SmoothMoves.BoneAnimation>();
 }
示例#26
0
    // Use this for initialization
    void Start()
    {
        //載入角色資訊
        this.roleInfo = this.GetComponent<RolePropertyInfo>();
        this.isUsingSkill = false;

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterColliderTriggerDelegate(WeaponHit);
        this.boneAnimation.RegisterUserTriggerDelegate(ShootEvent);
        GameManager.script.RegisterBoneAnimation(this.boneAnimation);   //註冊BoneAnimation,GameManager統一管理
    }
示例#27
0
    // Use this for initialization
    void Start()
    {
        script = this;
        GameManager.script.CurrentBossObject = this.gameObject; //紀錄當前魔王物件(使用絕技要暫停iTween)

        //載入敵人資訊
        this.bossInfo = this.GetComponent<BossPropertyInfo>();

        //設定BoneAnimation
        this.boneAnimation = this.GetComponent<SmoothMoves.BoneAnimation>();
        this.boneAnimation.RegisterUserTriggerDelegate(UserTrigger);
        this.boneAnimation.RegisterColliderTriggerDelegate(WeaponHit);
        GameManager.script.RegisterBoneAnimation(this.boneAnimation);   //註冊BoneAnimation,GameManager統一管理

        //紀錄原始Scale
        this.originScale = this.transform.localScale;

        //抓到Boss的定位點
        foreach (var pos in this.BattlePositionList)
            pos.PositionTransform = GameObject.Find(pos.PositionName).transform;

        this.NextActionTime = 0;

        //測試用,進行魔王登場
        this.BossReadyAppear();
    }