示例#1
0
    // Start is called before the first frame update
    void Start()
    {
        _monobitView = GetComponent <MonobitEngine.MonobitView>();


        _myID = MonobitEngine.MonobitNetwork.playerList.Length;
    }
示例#2
0
    // オブジェクト動的破棄のカスタマイズ
    public void Destroy(GameObject obj)
    {
        MonobitEngine.MonobitView view = obj.GetComponent <MonobitEngine.MonobitView>();
        var instanceID = obj.GetInstanceID();

        if (view != null && m_InstanceIDToObject.ContainsKey(instanceID))
        {
            // 自身のオブジェクトであれば非アクティブ化
            obj.SetActive(false);
            var path = m_InstanceIDToPrefabPath[obj.GetInstanceID()];
            if (m_PoolObjectParents.ContainsKey(path))
            {
                var parent = m_PoolObjectParents[path];
                if (parent != null)
                {
                    obj.transform.SetParent(parent.transform);
                }
            }
        }
        else
        {
            // 他クライアントからのオブジェクトであれば破棄
            GameObject.Destroy(obj);
        }
    }
示例#3
0
 private void Awake()
 {
     this._monobitView = GetComponent <MonobitEngine.MonobitView>();
     if (this._monobitView != null && !this._monobitView.isMine)
     {
         return;
     }
     InitAnimation();
 }
        private Vector3 m_LastUpdateScale       = Vector3.one;             /**< 受信した最新の倍率情報. */

        /**
         * 起動関数.
         */
        void Awake()
        {
            // 自身のオブジェクトに対して MonobitView コンポーネントを検索して設定する
            if (GetComponent <MonobitView>() != null)
            {
                m_MonobitView = GetComponent <MonobitView>();
            }
            // 自身のオブジェクトに存在しない場合、最上位の親オブジェクトに対して MonobitView コンポーネントを検索して設定する
            else
            {
                m_MonobitView = transform.root.GetComponent <MonobitView>();
            }
        }
    // Update is called once per frame
    void Update()
    {
        if (view == null)
        {
            view = GetComponent <MonobitEngine.MonobitView>();
        }

        if (!view.isMine)
        {
            return;
        }

        if (targetMarker == null)
        {
            targetMarker = GameObject.Find("target").transform;
        }
        Vector3 xx = targetMarker.GetComponent <targetPointer>().targetingPOINT;

        weaponSelector.SetTargetPoint(this);

        bool xxv = !(!Look && !Debeg_LOOK);

        if (xxv)
        {
            weaponSelector.weaponA.transform.LookAt(xx);
            weaponSelector.weaponB.transform.LookAt(xx);
        }
        else
        {
            weaponSelector.weaponA.transform.localRotation = Quaternion.Euler(weaponSelector.weaponA.GetComponent <GunBehavior>().layoutAngle);
            weaponSelector.weaponB.transform.localRotation = Quaternion.Euler(weaponSelector.weaponB.GetComponent <GunBehavior>().layoutAngle);
        }

        IK_Driver.handL.enable = xxv && LeftGun;
        IK_Driver.handL.weight = IK_Weight;
        if (LeftGun)
        {
            IK_Driver.handL.target.position = (Vector3.Distance(xx, HandL.position) < 0.4f) ? xx : (xx - HandL.position).normalized * ArmIK_Weight + HandL.position;
        }

        IK_Driver.handR.enable = xxv && RightGun;
        IK_Driver.handR.weight = IK_Weight;
        if (RightGun)
        {
            IK_Driver.handR.target.position = (Vector3.Distance(xx, HandR.position) < 0.4f) ? xx : (xx - HandR.position).normalized * ArmIK_Weight + HandR.position;
        }
    }
示例#6
0
    private void Awake()
    {
        this._monobitView = GetComponent <MonobitEngine.MonobitView>();
        if (this._monobitView != null && !this._monobitView.isMine)
        {
            return;
        }

        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            throw new System.Exception();
        }
    }
示例#7
0
 void Awake()
 {
     // すべての親オブジェクトに対して MonobitView コンポーネントを検索する
     if (GetComponentInParent <MonobitEngine.MonobitView>() != null)
     {
         m_MonobitView = GetComponentInParent <MonobitEngine.MonobitView>();
     }
     // 親オブジェクトに存在しない場合、すべての子オブジェクトに対して MonobitView コンポーネントを検索する
     else if (GetComponentInChildren <MonobitEngine.MonobitView>() != null)
     {
         m_MonobitView = GetComponentInChildren <MonobitEngine.MonobitView>();
     }
     // 親子オブジェクトに存在しない場合、自身のオブジェクトに対して MonobitView コンポーネントを検索して設定する
     else
     {
         m_MonobitView = GetComponent <MonobitEngine.MonobitView>();
     }
 }
示例#8
0
    private void Awake()
    {
        this._monobitView = GetComponent <MonobitEngine.MonobitView>();

        if (this._monobitView != null && !this._monobitView.isMine)
        {
            return;
        }
        this._rigidbody           = GetComponent <Rigidbody>();
        this._playerAnimation     = GetComponent <PlayerAnimation>();
        this._characterController = GetComponent <CharacterController>();
        this._hitHeadCheck        = this.transform.Find("HitHeadCheck").transform;
        this._groundCheck         = this.transform.Find("GroundCheck").transform;
        this._wallKickTrigger     = this.transform.Find("WallCheck").GetComponent <WallKickTrigger>();

        this._characterController
        .ObserveEveryValueChanged(x => x.isGrounded)
        //.ThrottleFrame(1)
        .Subscribe(x => this._isGrounded = x);
        this.isTitleScene = SceneManager.GetActiveScene().name == "Title";
    }
        private Vector3 m_LastUpdateScale       = Vector3.one;             /**< 受信した最新の倍率情報. */

        /**
         * 起動関数.
         */
        void Awake()
        {
            m_MonobitView = GetComponent <MonobitView>();
        }
示例#10
0
 private void Awake()
 {
     this._monobitView         = this.transform.parent.GetComponent <MonobitEngine.MonobitView>();
     this.playerMoveController = this.transform.parent.GetComponent <PlayerMovementBasedCamera>();
     this._collider            = this.GetComponent <BoxCollider>();
 }
示例#11
0
 // Start is called before the first frame update
 void Start()
 {
     _monobitview = GetComponent <MonobitEngine.MonobitView>();
 }