예제 #1
0
        /// <summary>
        /// 接触したポップアップポイントに待機中のフォロワーが存在する場合はそのフォロワーを連れていく(追従させる)
        /// </summary>
        /// <param name="popup"></param>
        private void TakeFollower(PopupPoint popup)
        {
            if (!popup.IsExsistFollower())
            {
                return;
            }

            // フォロワーに追従させる対象を決定する(すでにフォロワーが追従している場合は一番後ろのフォロワーを対象にする)
            Transform target        = mTrans;
            int       followerCount = mFollowerList.Count;

            if (followerCount > 0)
            {
                target = mFollowerList.Last().gameObject.GetComponent <Transform>();
            }

            // フォロワーの追従開始
            FollowerModel follower = popup.DeleverFollower();

            follower.Follow(target, followerCount);

            // フォロワーをリストに追加し、プレイヤーとフォロワーの移動速度を再設定
            mFollowerList.Add(follower);
            SetSpeed();
            foreach (FollowerModel model in mFollowerList)
            {
                model.SetSpeed(mSpeed);
            }
        }
예제 #2
0
 /// <summary>
 /// フォロワーをポップアップさせる
 /// 同時にエフェクトを発生させる
 /// </summary>
 public void PopupFollower()
 {
     if (mFollower == null)
     {
         GameObject model = Instantiate(prefabFollower, transform.position, Quaternion.identity);
         mFollower = model.GetComponent <FollowerModel>();
     }
     mFollower.Popup();
     mEffectBox.SetActive(true);
 }