예제 #1
0
        public override bool Tap(Main_PlayerCharacter chara)
        {
            if (_Character == chara)
            {
                base.Tap(chara);

                if (isOn)
                {
                    foreach (var obj in _Targets)
                    {
                        obj.SetActive(true);
                    }
                    _Sprite_Off.enabled = true;
                    _Sprite_On.enabled  = false;
                    isOn = false;
                }
                else
                {
                    foreach (var obj in _Targets)
                    {
                        obj.SetActive(false);
                    }
                    _Sprite_Off.enabled = false;
                    _Sprite_On.enabled  = true;
                    isOn = true;
                }
            }
            return(true);
        }
        private void OnTriggerExit(Collider other)
        {
            var component = other.GetComponent <Main_PlayerCharacter>();

            if (component == _Player)
            {
                _Player = null;
            }
        }
        private void OnTriggerEnter(Collider other)
        {
            var component = other.GetComponent <Main_PlayerCharacter>();

            if (component != null)
            {
                _Player = component;
            }
        }
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.layer == (int)Layers.Character)
     {
         var chara = other.GetComponent <Main_PlayerCharacter>();
         if (chara == _Character)
         {
             _Sprite.gameObject.SetActive(false);
             _Character = null;
         }
     }
 }
예제 #5
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.layer == (int)Layers.Character)
     {
         var chara = other.GetComponent <Main_PlayerCharacter>();
         //Debug.Log(chara);
         if (chara != null)
         {
             _Sprite.gameObject.SetActive(true);
             _Character = chara;
         }
     }
 }
        public override bool Tap(Main_PlayerCharacter chara)
        {
            if (_Character == chara)
            {
                base.Tap(chara);

                if (isOn)
                {
                    if (canOff)
                    {
                        if (_Event_Off)
                        {
                            _Event_Off.StartEvent();
                        }
                        if (_Obj_Off)
                        {
                            _Obj_Off.SetActive(true);
                        }
                        if (_Obj_On)
                        {
                            _Obj_On.SetActive(false);
                        }
                        isOn = false;
                    }
                }
                else
                {
                    if (_Event_On)
                    {
                        _Event_On.StartEvent();
                    }
                    if (_Obj_Off)
                    {
                        _Obj_Off.SetActive(false);
                    }
                    if (_Obj_On)
                    {
                        _Obj_On.SetActive(true);
                    }
                    isOn = true;
                    if (!canOff)
                    {
                        _Sprite.gameObject.SetActive(false);
                    }
                }
            }

            return(true);
        }
        /// <summary>
        /// 操作中のプレイヤーキャラの鉄棒を補充する
        /// </summary>
        /// <returns></returns>
        public override bool Tap(Main_PlayerCharacter chara)
        {
            float r = Main_GameManager.MainSettings.BarStorage_Radius;
            //設定の距離よりも近ければ
            var pos1 = new Vector2(chara.transform.position.x, chara.transform.position.z);
            var pos2 = new Vector2(transform.position.x, transform.position.z);

            Debug.Log(Vector3.SqrMagnitude(pos1 - pos2));
            if (Vector3.SqrMagnitude(pos1 - pos2) <= r * r)
            {
                return(chara.ReplenishmentBar());
            }

            return(false);
        }
예제 #8
0
        /// <summary>
        /// 操作中のプレイヤーキャラの鉄棒を補充する
        /// </summary>
        /// <returns></returns>
        ///
        private void OnTriggerEnter(Collider other)
        {
            Debug.Log(other);
            if (other.gameObject.layer == (int)Layers.Character)
            {
                Main_PlayerCharacter chara = other.GetComponent <Main_PlayerCharacter>();
                if (chara == null)
                {
                    return;
                }

                float r = Main_GameManager.MainSettings.BarStorage_Radius;
                //設定の距離よりも近ければ
                var pos1 = new Vector2(chara.transform.position.x, chara.transform.position.z);
                var pos2 = new Vector2(transform.position.x, transform.position.z);
                chara.ReplenishmentBar();
            }
        }
예제 #9
0
 public virtual void LockOn(Main_PlayerCharacter PlayerCharacter)
 {
 }
예제 #10
0
 /// <summary>
 /// 鉄液がヒットしたときに鉄液側から呼び出される
 /// </summary>
 public virtual bool Tap(Main_PlayerCharacter chara)
 {
     Debug.Log("Hit");
     return(false);
 }