Ejemplo n.º 1
0
    private void LaunchBouquet()
    {
        Quaternion rot = this.gameObject.transform.rotation;
        Vector3    pos = this.transform.position + (rot * m_launchPoint);

        int bonusCharm = m_magazine.UseBonusCharmBullet();

        UnityAction <Vector3> act = (vec) =>
        {
            GameObject obj = XFunctions.Instance(m_bulletBouquet, pos, rot);
            Rigidbody  rb  = obj.GetComponent <Rigidbody>();
            rb.AddForce(vec * m_shotPower, ForceMode.Impulse);
            BulletCtrl ctrl = obj.GetComponent <BulletCtrl>();
            ctrl.SetUserID(m_parent.GetComponent <UserData>().userID);
            ctrl.AddBonusCharm(bonusCharm);
        };

        act.Invoke(this.transform.forward);
        if (m_magazine.UseBonus3WayBullet())
        {
            act.Invoke(Quaternion.AngleAxis(-m_shot3WayAngle, Vector3.up) * this.transform.forward);
            act.Invoke(Quaternion.AngleAxis(m_shot3WayAngle, Vector3.up) * this.transform.forward);
        }
        else
        {
            m_magazine.SubBullet(m_costChargeBullet);
        }
        m_knockback += m_knockbackTime;
    }
Ejemplo n.º 2
0
    /*
     * /// <summary>
     * /// GuestのPop処理
     * /// </summary>
     * /// <param name="baseObject">GuestのBaseObject</param>
     * /// <param name="destination">目的地</param>
     * /// <param name="goOutDestination">退避時の目的地</param>
     * private GameObject PopGuest(GameObject baseObject, Transform destination, Transform goOutDestination)
     * {
     *  GameObject obj = XFunctions.Instance(baseObject, this.transform.position, this.transform.rotation);
     *  CharNaviCtrl ctrl = obj.GetComponent<CharNaviCtrl>();
     *  ctrl.SetNavTarget(destination);
     *  // TODO
     *  return obj;
     * }
     */
    /// <summary>
    /// GuestのPop処理
    /// </summary>
    /// <param name="baseObject">GuestのBaseObject</param>
    /// <param name="destination">目的地(固定)</param>
    /// <param name="goOutDestination">退避時の目的地</param>
    private GameObject PopGuest(GameObject baseObject, Vector3 destination, Vector3 goOutDestination)
    {
        GameObject obj = XFunctions.Instance(baseObject, this.transform.position, this.transform.rotation);

        obj.GetComponent <GuestCtrl>().SetDestination(destination, goOutDestination);
        // TODO
        return(obj);
    }
Ejemplo n.º 3
0
    private void LaunchBouquet()
    {
        Quaternion rot = this.gameObject.transform.rotation;
        Vector3    pos = this.transform.position + (rot * m_launchPoint);

        GameObject obj = XFunctions.Instance(m_bulletBouquet, pos, rot);
        Rigidbody  rb  = obj.GetComponent <Rigidbody>();

        rb.AddForce(this.transform.forward * m_shotPower, ForceMode.Impulse);
        BulletCtrl ctrl = obj.GetComponent <BulletCtrl>();

        ctrl.SetUserID(m_parent.GetComponent <UserData>().userID);
        ctrl.AddBonusCharm(m_magazine.UseBonusCharmBullet());

        m_magazine.SubBullet(m_costChargeBullet);

        m_knockback += m_knockbackTime;
    }
Ejemplo n.º 4
0
    void Awake()
    {
        XLogger.LogValidObject(m_parent == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Parent"), gameObject);
        XLogger.LogValidObject(m_bullet == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Bullte"), gameObject);
        XLogger.LogValidObject(m_bulletBouquet == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("BullteBouquet"), gameObject);
        XLogger.LogValidObject(m_hitPoint == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("HitPoint"), gameObject);

        XLogger.LogValidObject(m_efReload == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Effect Reload"), gameObject);
        XLogger.LogValidObject(m_efMaxCharge == null, LibConstants.ErrorMsg.GetMsgNotBoundComponent("Effect MaxCharge"), gameObject);

        m_magazine     = this.GetComponent <LauncherMagazine>();
        m_lineRenderer = this.GetComponent <LineRenderer>();

        GameObject efCharging  = XFunctions.InstanceChild(m_efCharging, Vector3.zero, Quaternion.identity, this.gameObject);
        GameObject efObj       = XFunctions.InstanceChild(m_efMaxCharge, Vector3.zero, Quaternion.identity, this.gameObject);
        GameObject efReloadObj = XFunctions.InstanceChild(m_efReload, Vector3.zero, Quaternion.identity, this.gameObject);

        m_csEfCharging  = efCharging.GetComponent <IEffect>();
        m_csEfMaxCharge = efObj.GetComponent <IEffect>();
        m_csEfReload    = efReloadObj.GetComponent <IEffect>();
    }